
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Plugins &#8212; Leo 6.7.2 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/classic.css" />
    <link rel="stylesheet" type="text/css" href="_static/custom.css" />
    
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/sphinx_highlight.js"></script>
    
    <script src="_static/sidebar.js"></script>
    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Leo’s Commands Reference" href="commands.html" />
    <link rel="prev" title="Customizing Leo" href="customizing.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="commands.html" title="Leo’s Commands Reference"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="customizing.html" title="Customizing Leo"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="leo_toc.html">Leo 6.7.2 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="usersguide.html" accesskey="U">Leo’s Users Guide</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">Plugins</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="plugins">
<h1>Plugins<a class="headerlink" href="#plugins" title="Permalink to this heading">¶</a></h1>
<p>This chapter discusses Leo’s plugins. The plugins found in LeoPyRef.leo are part of Leo’s official distribution. The next chapter, <a class="reference external" href="writingPlugins.html">Writing Plugins</a>, tells how to write plugins.</p>
<p>The scripting plugin (mod_scripting.py) deserves special mention. This plugin lets you create <strong>script buttons</strong> in a matter of seconds. See <a class="reference external" href="tutorial-scripting#using-button-nodes">Using &#64;button nodes</a>. Script buttons are extraordinarily useful.</p>
<div class="contents local topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#enabling-plugins" id="id2">Enabling plugins</a></p></li>
<li><p><a class="reference internal" href="#summary" id="id3">Summary</a></p></li>
<li><p><a class="reference internal" href="#gui-independent-plugins" id="id4">Gui-independent plugins</a></p>
<ul>
<li><p><a class="reference internal" href="#commands-directives" id="id5">Commands &amp; directives</a></p>
<ul>
<li><p><a class="reference internal" href="#add-directives-py" id="id6">add_directives.py</a></p></li>
<li><p><a class="reference internal" href="#bzr-qcommands-py" id="id7">bzr_qcommands.py</a></p></li>
<li><p><a class="reference internal" href="#codewisecompleter-py" id="id8">codewisecompleter.py</a></p></li>
<li><p><a class="reference internal" href="#ctagscompleter-py" id="id9">ctagscompleter.py</a></p></li>
<li><p><a class="reference internal" href="#empty-leo-file-py" id="id10">empty_leo_file.py</a></p></li>
<li><p><a class="reference internal" href="#ftp-py" id="id11">ftp.py</a></p></li>
<li><p><a class="reference internal" href="#gitarchive-py" id="id12">gitarchive.py</a></p></li>
<li><p><a class="reference internal" href="#import-cisco-config-py" id="id13">import_cisco_config.py</a></p></li>
<li><p><a class="reference internal" href="#initinclass-py" id="id14">initinclass.py</a></p></li>
<li><p><a class="reference internal" href="#leofeeds-py" id="id15">leofeeds.py</a></p></li>
<li><p><a class="reference internal" href="#leomail-py" id="id16">leomail.py</a></p></li>
<li><p><a class="reference internal" href="#leo-interface-py" id="id17">leo_interface.py</a></p></li>
<li><p><a class="reference internal" href="#linenumbers-py" id="id18">lineNumbers.py</a></p></li>
<li><p><a class="reference internal" href="#macros-py" id="id19">macros.py</a></p></li>
<li><p><a class="reference internal" href="#markup-inline-py" id="id20">markup_inline.py</a></p></li>
<li><p><a class="reference internal" href="#mod-autosave-py" id="id21">mod_autosave.py</a></p></li>
<li><p><a class="reference internal" href="#mod-read-dir-outline-py" id="id22">mod_read_dir_outline.py</a></p></li>
<li><p><a class="reference internal" href="#mod-timestamp-py" id="id23">mod_timestamp.py</a></p></li>
<li><p><a class="reference internal" href="#nodeactions-py" id="id24">nodeActions.py</a></p></li>
<li><p><a class="reference internal" href="#nodediff-py" id="id25">nodediff.py</a></p></li>
<li><p><a class="reference internal" href="#outline-export-py" id="id26">outline_export.py</a></p></li>
<li><p><a class="reference internal" href="#paste-as-headlines-py" id="id27">paste_as_headlines.py</a></p></li>
<li><p><a class="reference internal" href="#quickmove-py" id="id28">quickMove.py</a></p></li>
<li><p><a class="reference internal" href="#sethomedirectory-py" id="id29">setHomeDirectory.py</a></p></li>
<li><p><a class="reference internal" href="#sftp-py" id="id30">sftp.py</a></p></li>
<li><p><a class="reference internal" href="#threadutil-py" id="id31">threadutil.py</a></p></li>
<li><p><a class="reference internal" href="#word-count-py" id="id32">word_count.py</a></p></li>
<li><p><a class="reference internal" href="#xml-edit" id="id33">xml_edit</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#debugging" id="id34">Debugging</a></p>
<ul>
<li><p><a class="reference internal" href="#debugger-pudb-py" id="id35">debugger_pudb.py</a></p></li>
<li><p><a class="reference internal" href="#dump-globals-py" id="id36">dump_globals.py</a></p></li>
<li><p><a class="reference internal" href="#enable-gc-py" id="id37">enable_gc.py</a></p></li>
<li><p><a class="reference internal" href="#quit-leo-py" id="id38">quit_leo.py</a></p></li>
<li><p><a class="reference internal" href="#trace-gc-plugin-py" id="id39">trace_gc_plugin.py</a></p></li>
<li><p><a class="reference internal" href="#trace-keys-py" id="id40">trace_keys.py</a></p></li>
<li><p><a class="reference internal" href="#trace-tags-py" id="id41">trace_tags.py</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#external-programs" id="id42">External programs</a></p>
<ul>
<li><p><a class="reference internal" href="#ipython-py" id="id43">ipython.py</a></p></li>
<li><p><a class="reference internal" href="#open-shell-py" id="id44">open_shell.py</a></p></li>
<li><p><a class="reference internal" href="#tomboy-import-py" id="id45">tomboy_import.py</a></p></li>
<li><p><a class="reference internal" href="#vim-py" id="id46">vim.py</a></p></li>
<li><p><a class="reference internal" href="#xemacs-py" id="id47">xemacs.py</a></p></li>
<li><p><a class="reference internal" href="#word-export-py" id="id48">word_export.py</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#files-and-nodes" id="id49">Files and nodes</a></p>
<ul>
<li><p><a class="reference internal" href="#active-path-py" id="id50">active_path.py</a></p></li>
<li><p><a class="reference internal" href="#at-folder-py" id="id51">at_folder.py</a></p></li>
<li><p><a class="reference internal" href="#at-produce-py" id="id52">at_produce.py</a></p></li>
<li><p><a class="reference internal" href="#at-view-py" id="id53">at_view.py</a></p></li>
<li><p><a class="reference internal" href="#backlink-py" id="id54">backlink.py</a></p></li>
<li><p><a class="reference internal" href="#datenodes-py" id="id55">datenodes.py</a></p></li>
<li><p><a class="reference internal" href="#expfolder-py" id="id56">expfolder.py</a></p></li>
<li><p><a class="reference internal" href="#fileactions-py" id="id57">FileActions.py</a></p></li>
<li><p><a class="reference internal" href="#geotag-py" id="id58">geotag.py</a></p></li>
<li><p><a class="reference internal" href="#injarnder-py" id="id59">injarnder.py</a></p></li>
<li><p><a class="reference internal" href="#leocursor-py" id="id60">leocursor.py</a></p></li>
<li><p><a class="reference internal" href="#leoopml-py" id="id61">leoOPML.py</a></p></li>
<li><p><a class="reference internal" href="#mime-py" id="id62">mime.py</a></p></li>
<li><p><a class="reference internal" href="#multifile-py" id="id63">multifile.py</a></p></li>
<li><p><a class="reference internal" href="#nicenosent-py" id="id64">niceNosent.py</a></p></li>
<li><p><a class="reference internal" href="#notebook-py" id="id65">notebook.py</a></p></li>
<li><p><a class="reference internal" href="#read-only-nodes-py" id="id66">read_only_nodes.py</a></p></li>
<li><p><a class="reference internal" href="#run-nodes-py" id="id67">run_nodes.py</a></p></li>
<li><p><a class="reference internal" href="#startfile-py" id="id68">startfile.py</a></p></li>
<li><p><a class="reference internal" href="#timestamp-py" id="id69">timestamp.py</a></p></li>
<li><p><a class="reference internal" href="#xsltwithnodes-py" id="id70">xsltWithNodes.py</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#scripting" id="id71">Scripting</a></p>
<ul>
<li><p><a class="reference internal" href="#dyna-menu" id="id72">dyna_menu</a></p></li>
<li><p><a class="reference internal" href="#leoscreen-py" id="id73">leoscreen.py</a></p></li>
<li><p><a class="reference internal" href="#mod-scripting-py" id="id74">mod_scripting.py</a></p></li>
<li><p><a class="reference internal" href="#script-io-to-body-py" id="id75">script_io_to_body.py</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#servers" id="id76">Servers</a></p>
<ul>
<li><p><a class="reference internal" href="#leo-cloud-py" id="id77">leo_cloud.py</a></p></li>
<li><p><a class="reference internal" href="#leoremote-py" id="id78">leoremote.py</a></p></li>
<li><p><a class="reference internal" href="#mod-http-py" id="id79">mod_http.py</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#slideshows-and-screenshots" id="id80">Slideshows and screenshots</a></p>
<ul>
<li><p><a class="reference internal" href="#demo-py" id="id81">demo.py</a></p></li>
<li><p><a class="reference internal" href="#screenshots-py" id="id82">screenshots.py</a></p></li>
<li><p><a class="reference internal" href="#slideshow-py" id="id83">slideshow.py</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#text-formatting" id="id84">Text formatting</a></p>
<ul>
<li><p><a class="reference internal" href="#bibtex-py" id="id85">bibtex.py</a></p></li>
<li><p><a class="reference internal" href="#dtest-py" id="id86">dtest.py</a></p></li>
<li><p><a class="reference internal" href="#leo-to-html-py" id="id87">leo_to_html.py</a></p></li>
<li><p><a class="reference internal" href="#leo-to-rtf-py" id="id88">leo_to_rtf.py</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#user-interface" id="id89">User interface</a></p>
<ul>
<li><p><a class="reference internal" href="#chapter-hoist-py" id="id90">chapter_hoist.py</a></p></li>
<li><p><a class="reference internal" href="#editattributes-py" id="id91">EditAttributes.py</a></p></li>
<li><p><a class="reference internal" href="#interact-py" id="id92">interact.py</a></p></li>
<li><p><a class="reference internal" href="#maximizenewwindows-py" id="id93">maximizeNewWindows.py</a></p></li>
<li><p><a class="reference internal" href="#mod-framesize-py" id="id94">mod_framesize.py</a></p></li>
<li><p><a class="reference internal" href="#plugins-menu-py" id="id95">plugins_menu.py</a></p></li>
<li><p><a class="reference internal" href="#redirect-to-log-py" id="id96">redirect_to_log.py</a></p></li>
<li><p><a class="reference internal" href="#scripts-menu-py" id="id97">scripts_menu.py</a></p></li>
<li><p><a class="reference internal" href="#unl-py" id="id98">UNL.py</a></p></li>
<li><p><a class="reference internal" href="#zenity-file-dialogs-py" id="id99">zenity_file_dialogs.py</a></p></li>
</ul>
</li>
</ul>
</li>
<li><p><a class="reference internal" href="#qt-only-plugins" id="id100">Qt only plugins</a></p>
<ul>
<li><p><a class="reference internal" href="#attrib-edit-py" id="id101">attrib_edit.py</a></p></li>
<li><p><a class="reference internal" href="#bigdash-py" id="id102">bigdash.py</a></p></li>
<li><p><a class="reference internal" href="#bookmarks-py" id="id103">bookmarks.py</a></p></li>
<li><p><a class="reference internal" href="#colorize-headlines-py" id="id104">colorize_headlines.py</a></p></li>
<li><p><a class="reference internal" href="#contextmenu-py" id="id105">contextmenu.py</a></p></li>
<li><p><a class="reference internal" href="#dragdropgoodies-py" id="id106">dragdropgoodies.py</a></p></li>
<li><p><a class="reference internal" href="#graphcanvas-py" id="id107">graphcanvas.py</a></p></li>
<li><p><a class="reference internal" href="#leomylyn-py" id="id108">leomylyn.py</a></p></li>
<li><p><a class="reference internal" href="#livecode-py" id="id109">livecode.py</a></p></li>
<li><p><a class="reference internal" href="#nav-qt-py" id="id110">nav_qt.py</a></p></li>
<li><p><a class="reference internal" href="#nodetags-py" id="id111">nodetags.py</a></p></li>
<li><p><a class="reference internal" href="#printing-py" id="id112">printing.py</a></p></li>
<li><p><a class="reference internal" href="#projectwizard-py" id="id113">projectwizard.py</a></p></li>
<li><p><a class="reference internal" href="#python-terminal-py" id="id114">python_terminal.py</a></p></li>
<li><p><a class="reference internal" href="#qncalendarwidgets" id="id115">QNCalendarWidgets</a></p></li>
<li><p><a class="reference internal" href="#quicksearch-py" id="id116">quicksearch.py</a></p></li>
<li><p><a class="reference internal" href="#richtext-py" id="id117">richtext.py</a></p></li>
<li><p><a class="reference internal" href="#screen-capture-py" id="id118">screen_capture.py</a></p></li>
<li><p><a class="reference internal" href="#screencast-py" id="id119">screencast.py</a></p></li>
<li><p><a class="reference internal" href="#scrolledmessage-py" id="id120">scrolledmessage.py</a></p></li>
<li><p><a class="reference internal" href="#settings-finder-py" id="id121">settings_finder.py</a></p></li>
<li><p><a class="reference internal" href="#spydershell-py" id="id122">spydershell.py</a></p></li>
<li><p><a class="reference internal" href="#stickynotes-py" id="id123">stickynotes.py</a></p></li>
<li><p><a class="reference internal" href="#systray-py" id="id124">systray.py</a></p></li>
<li><p><a class="reference internal" href="#todo-py" id="id125">todo.py</a></p></li>
<li><p><a class="reference internal" href="#valuespace-py" id="id126">valuespace.py</a></p></li>
<li><p><a class="reference internal" href="#viewrendered-py" id="id127">viewrendered.py</a></p></li>
<li><p><a class="reference internal" href="#viewrendered2-py" id="id128">viewrendered2.py</a></p></li>
<li><p><a class="reference internal" href="#wikiview-py" id="id129">wikiview.py</a></p></li>
</ul>
</li>
</ul>
</div>
<section id="enabling-plugins">
<h2><a class="toc-backref" href="#id2">Enabling plugins</a><a class="headerlink" href="#enabling-plugins" title="Permalink to this heading">¶</a></h2>
<p>You enable or disable plugins using &#64;enabled-plugins nodes in leoSettings files (leoSettings.leo, myLeoSettings.leo or the .leo file being loaded). See <a class="reference external" href="customizing.html#specifying-settings">Specifying settings</a> for full details of settings files.</p>
<p>The body text of the &#64;enabled-plugins node contains a list of enabled plugins. Notes:</p>
<ul class="simple">
<li><p>Leo attempts to load all plugins every time an &#64;enabled-plugins node is seen. If the plugin has already been loaded, Leo silently ignores the request to re-enable the plugin. Leo never attempts to disable a plugin while processing enabled plugin strings. Thus, plugins enabled in an &#64;enabled-plugins node in leoSettings.leo <em>will</em> be enabled regardless of the contents of any other &#64;enabled-plugins node.</p></li>
<li><p>You can enable plugins by file name or by module name.  File names end in .py and are resolved relative to the leo/plugins directory.  Module names do <em>not</em> end in .py and are found using Python’s import mechanism–the module name must be on PYTHONPATH.</p></li>
<li><p>g.app.gui.getEnabledPlugins contains the last processed &#64;enabled-plugins node.</p></li>
</ul>
</section>
<section id="summary">
<h2><a class="toc-backref" href="#id3">Summary</a><a class="headerlink" href="#summary" title="Permalink to this heading">¶</a></h2>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">active_path.py</span></code></dt><dd><p>Synchronizes &#64;path nodes with folders.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">bookmarks.py</span></code></dt><dd><p>Manages bookmarks using a separate pane.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">add_directives.py</span></code></dt><dd><p>Allows users to define new &#64;directives.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">at_folder.py</span></code></dt><dd><p>Synchronizes &#64;folder nodes with folders.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">at_produce.py</span></code></dt><dd><p>Executes commands in nodes whose body text starts with &#64;produce.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">at_view.py</span></code></dt><dd><p>Adds support for &#64;clip, &#64;view and &#64;strip nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">attrib_edit.py</span></code></dt><dd><p>Edits user attributes in a Qt frame.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">backlink.py</span></code></dt><dd><p>Allows arbitrary links between nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">bibtex.py</span></code></dt><dd><p>Manages BibTeX files with Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">bigdash.py</span></code></dt><dd><p>Creates a global search window.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">bookmarks.py</span></code></dt><dd><p>Manages bookmarks using a separate pane.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">bzr_qcommands.py</span></code></dt><dd><p>Adds a context menu to each node containing all the commands in the bzr Qt
interface. Bzr is invoked based on the path of the current node.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">chapter_hoist.py</span></code></dt><dd><p>Creates hoist buttons.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">codewisecompleter.py</span></code></dt><dd><p>Uses the ctags database to provide an autocompletion list.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">colorize_headlines.py</span></code></dt><dd><p>Manipulates appearance of individual tree widget items.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">contextmenu.py</span></code></dt><dd><p>Defines various useful actions for context menus (Qt only).</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">ctagscompleter.py</span></code></dt><dd><p>Uses ctags to provide an autocompletion list.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">datenodes.py</span></code></dt><dd><p>Allows users to insert headlines containing dates.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">debugger_pudb.py</span></code></dt><dd><p>Makes g.pdb() enter the Pudb debugger instead of pdb.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">demo.py</span></code></dt><dd><p>Creates slides or interactive demos.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">dragdropgoodies</span></code></dt><dd><p>Dumps files dropped into Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">dtest.py</span></code></dt><dd><p>Sends code to the doctest module and reports the result.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">dragdropgoodies</span></code></dt><dd><p>Dumps files dropped into Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">dump_globals.py</span></code></dt><dd><p>Dumps Python globals at startup.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">EditAttributes.py</span></code></dt><dd><p>Lets the user associate text with a specific node.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">empty_leo_file.py</span></code></dt><dd><p>Allows Leo to open any empty file as a minimal .leo file.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">enable_gc.py</span></code></dt><dd><p>Enables debugging and tracing for Python’s garbage collector.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">expfolder.py</span></code></dt><dd><p>Adds &#64;expfolder nodes that represent folders in the file system.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">FileActions.py</span></code></dt><dd><p>Defines actions taken when double-clicking on &#64;&lt;file&gt; nodes and
supports &#64;file-ref nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">ftp.py</span></code></dt><dd><p>Supports uploading of files via ftp.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">geotag.py</span></code></dt><dd><p>Tags nodes with latitude and longitude.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">gitarchive.py</span></code></dt><dd><p>Stores snapshots of outline in git.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">graphcanvas.py</span></code></dt><dd><p>Adds a graph layout for nodes in a tab.
Requires Qt and the backlink.py plugin.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">import_cisco_config.py</span></code></dt><dd><p>Allows the user to import Cisco configuration files.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">initinclass.py</span></code></dt><dd><p>Modifies the Python &#64;auto importer so that the importer
puts the __init__ method (ctor) into the body of the class node.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">interact.py</span></code></dt><dd><p>Adds buttons so Leo can interact with command line environments.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">jinjarender.py</span></code></dt><dd><p>Renders &#64;jinja nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leofeeds.py</span></code></dt><dd><p>Reads from rss, atom or other sources.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leo_interface.py</span></code></dt><dd><p>Allows the user to browse XML documents in Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leo_pdf.py</span></code></dt><dd><p>This NOT a Leo plugin: this is a docutils writer for .pdf files.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leo_to_html.py</span></code></dt><dd><p>Converts a leo outline to an html web page.**.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leo_to_rtf.py</span></code></dt><dd><p>Outputs a Leo outline as a numbered list to an RTF file. The RTF file can be
loaded into Microsoft Word and formatted as a proper outline.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leocursor.py</span></code></dt><dd><p>Creates a LeoCursor object that can walk around a Leo outline and decode
attributes from nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leofeeds.py</span></code></dt><dd><p>Reads from rss, atom or other sources.</p>
</dd>
</dl>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">leomail.py</span></code></dt><dd><p>Sync local mailbox files over to Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leomylyn.py</span></code></dt><dd><p>Provides a “Mylyn” like experience for Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leoOPML.py</span></code></dt><dd><p>Read and write .leo files in OPML.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leoremote.py</span></code></dt><dd><p>Remote control for Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">leoscreen.py</span></code></dt><dd><p>Allows interaction with shell apps via screen.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">lineNumbers.py</span></code></dt><dd><p>Adds #line directives in perl and perlpod programs.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">livecode.py</span></code></dt><dd><p>Creates a live code-evaluation pane.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">macros.py</span></code></dt><dd><p>Creates new nodes containing parameterized section references.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">markup_inline.py</span></code></dt><dd><p>Adds commands that create bold, italic or underlined text.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">maximizeNewWindows.py</span></code></dt><dd><p>Maximizes all new windows.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">mime.py</span></code></dt><dd><p>Opens files with their default platform program.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">mod_autosave.py</span></code></dt><dd><p>Autosaves the Leo outline every so often.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">mod_framesize.py</span></code></dt><dd><p>Sets a hard coded frame size.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">mod_http.py</span></code></dt><dd><p>An http plugin for Leo, based on AsyncHttpServer.py.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">mod_read_dir_outline.py</span></code></dt><dd><p>Allows Leo to read a complete directory tree into a Leo outline. Converts
directories into headlines and puts the list of file names into bodies.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">mod_scripting.py</span></code></dt><dd><p>Creates script buttons and &#64;button, &#64;command, &#64;plugin and &#64;script nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">mod_timestamp.py</span></code></dt><dd><p>Timestamps all save operations to show when they occur.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">multifile.py</span></code></dt><dd><p>Allows Leo to write a file to multiple locations.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">nav_qt.py</span></code></dt><dd><p>Adds “Back” and “Forward” buttons (Qt only).</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">niceNosent.py</span></code></dt><dd><p>Ensures that all descendants of &#64;file-nosent nodes end
with exactly one newline, replaces all tabs with spaces, and
adds a newline before class and functions in the derived file.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">nodeActions.py</span></code></dt><dd><p>Allows the definition of double-click actions.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">nodediff.py</span></code></dt><dd><p>Provides commands to run text diffs on node bodies within Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">nodeTags.py</span></code></dt><dd><p>Provides node tagging capabilities to Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">nodewatch.py</span></code></dt><dd><p>Adds scriptable &#64;nodewatch nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">notebook.py</span></code></dt><dd><p>Adds a QML notebook.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">open_shell.py</span></code></dt><dd><p>Creates an ‘Extensions’ menu containing two commands:
Open Console Window and Open Explorer.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">outline_export.py</span></code></dt><dd><p>Modifies the way exported outlines are written.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">paste_as_headlines.py</span></code></dt><dd><p>Creates new headlines from clipboard text.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">plugins_menu.py</span></code></dt><dd><p>Creates a Plugins menu and adds all actives plugins to it.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">projectwizard.py</span></code></dt><dd><p>Creates a wizard that creates &#64;auto nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">python_terminal.py</span></code></dt><dd><p>Embeds an python interpreter in Leo’s log pane.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">QNCalendarWidgets.py</span></code></dt><dd><p>Adds a calendar widget.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">quickMove.py</span></code></dt><dd><p>Creates buttons to move nodes quickly to other nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">quicksearch.py</span></code></dt><dd><p>Adds a fast-to-use search widget, like the “Find in files” feature of many editors.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">quit_leo.py</span></code></dt><dd><p>Shows how to force Leo to quit.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">read_only_nodes.py</span></code></dt><dd><p>Creates and updates &#64;read-only nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">redirect_to_log.py</span></code></dt><dd><p>Sends all output to the log pane.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">richtext.py</span></code></dt><dd><p>Enables rich text using the <a class="reference external" href="http://ckeditor.com/">CKEditor</a> editor.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rss.py</span></code></dt><dd><p>Adds rss reader features to Leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">run_nodes.py</span></code></dt><dd><p>Runs a program and interface Leos through its input/output/error streams.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">screen_capture.py</span></code></dt><dd><p>Supports taking screen shots.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">screenshots.py</span></code></dt><dd><p>Creates stand-alone slideshows containing screenshots.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">script_io_to_body.py</span></code></dt><dd><p>Sends output from the Execute Script command to the end of the body pane.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">scripts_menu.py</span></code></dt><dd><p>Creates a Scripts menu for LeoPy.leo.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">setHomeDirectory.py</span></code></dt><dd><p>Sets g.app.homeDir to a hard-coded path.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">sftp.py</span></code></dt><dd><p>Adds &#64;edit-like functionality for remote files over SFTP.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">slideshow.py</span></code></dt><dd><p>Support slideshows in Leo outlines.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">spydershell.py</span></code></dt><dd><p>Launches the spyder environment with access to Leo instance.
See <a class="reference external" href="http://packages.python.org/spyder/">http://packages.python.org/spyder/</a>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">startfile.py</span></code></dt><dd><p>Launches (starts) a file given by a headline when double-clicking the icon.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">stickynotes.py</span></code></dt><dd><p>Adds simple “sticky notes” feature (popout editors) for Qt gui.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">systray.py</span></code></dt><dd><p>Adds Leo to the system tray.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">threadutil.py</span></code></dt><dd><p>Adds utilities for asynchronous operation of commands.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">timestamp.py</span></code></dt><dd><p>Manages attributes containing node creation/modification/viewed times.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">todo.py</span></code></dt><dd><p>Provides to-do list and simple task management for leo (Qt only).</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tomboy_import.py</span></code></dt><dd><p>Allows imports of notes created in Tomboy / gnote.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">trace_gc_plugin.py</span></code></dt><dd><p>Traces changes to Leo’s objects at idle time.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">trace_keys.py</span></code></dt><dd><p>Traces keystrokes in the outline and body panes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">trace_tags.py</span></code></dt><dd><p>Traces most common hooks, but not key, drag or idle hooks.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">valuespace.py</span></code></dt><dd><p>Supports outline-based calculations similar to spreadsheets.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">viewrendered.py</span></code></dt><dd><p>Creates a window for <em>live</em> rendering of rst, html, etc.
This plugin uses docutils, <a class="reference external" href="http://docutils.sourceforge.net/">http://docutils.sourceforge.net/</a>,
to do the rendering, so installing docutils is recommended.
Supports &#64;graphics-script, &#64;image, &#64;html, &#64;movie and &#64;svg nodes.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">viewrendered2.py</span></code></dt><dd><p>An alternate/enhanced version of viewrendered.py.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">vim.py</span></code></dt><dd><p>Enables two-way communication with VIM.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">wikiview.py</span></code></dt><dd><p>Hides/shows parts of urls in the body editor.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">word_count.py</span></code></dt><dd><p>Counts characters, words, lines, and paragraphs in the body pane.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">word_export.py</span></code></dt><dd><p>Adds the Plugins:Word Export:Export menu item to format and export
the selected outline to a Word document, starting Word if necessary.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">xemacs.py</span></code></dt><dd><p>Allows you to edit nodes in emacs/xemacs.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">xml_edit.py</span></code></dt><dd><p>Adds commands for importing and exporting xml to and from Leo outlines.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">xsltWithNodes.py</span></code></dt><dd><p>Adds the Outline:XSLT menu containing XSLT-related commands.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">zenity_file_dialogs.py</span></code></dt><dd><p>Replaces Leo’s file dialogs on Linux with external
calls to the zenity gtk dialog package.</p>
</dd>
</dl>
</section>
<section id="gui-independent-plugins">
<h2><a class="toc-backref" href="#id4">Gui-independent plugins</a><a class="headerlink" href="#gui-independent-plugins" title="Permalink to this heading">¶</a></h2>
<section id="commands-directives">
<h3><a class="toc-backref" href="#id5">Commands &amp; directives</a><a class="headerlink" href="#commands-directives" title="Permalink to this heading">¶</a></h3>
<section id="add-directives-py">
<h4><a class="toc-backref" href="#id6">add_directives.py</a><a class="headerlink" href="#add-directives-py" title="Permalink to this heading">¶</a></h4>
<p>Allows users to define new &#64;directives.</p>
</section>
<section id="bzr-qcommands-py">
<h4><a class="toc-backref" href="#id7">bzr_qcommands.py</a><a class="headerlink" href="#bzr-qcommands-py" title="Permalink to this heading">¶</a></h4>
<p>Adds a context menu to each node containing all the commands in the bzr Qt interface. Bzr is invoked based on the path of the current node. <strong>Requires contextmenu.py.</strong></p>
</section>
<section id="codewisecompleter-py">
<h4><a class="toc-backref" href="#id8">codewisecompleter.py</a><a class="headerlink" href="#codewisecompleter-py" title="Permalink to this heading">¶</a></h4>
<p>Uses the ctags database to provide an autocompletion list.</p>
</section>
<section id="ctagscompleter-py">
<h4><a class="toc-backref" href="#id9">ctagscompleter.py</a><a class="headerlink" href="#ctagscompleter-py" title="Permalink to this heading">¶</a></h4>
<p>Uses ctags to provide an autocompletion list.</p>
</section>
<section id="empty-leo-file-py">
<h4><a class="toc-backref" href="#id10">empty_leo_file.py</a><a class="headerlink" href="#empty-leo-file-py" title="Permalink to this heading">¶</a></h4>
<p>Allows Leo to open any empty file as a minimal .leo file.</p>
</section>
<section id="ftp-py">
<h4><a class="toc-backref" href="#id11">ftp.py</a><a class="headerlink" href="#ftp-py" title="Permalink to this heading">¶</a></h4>
<p>Supports uploading of files via ftp.</p>
</section>
<section id="gitarchive-py">
<h4><a class="toc-backref" href="#id12">gitarchive.py</a><a class="headerlink" href="#gitarchive-py" title="Permalink to this heading">¶</a></h4>
<p>Stores snapshots of outline in git.</p>
</section>
<section id="import-cisco-config-py">
<h4><a class="toc-backref" href="#id13">import_cisco_config.py</a><a class="headerlink" href="#import-cisco-config-py" title="Permalink to this heading">¶</a></h4>
<p>Allows the user to import Cisco configuration files.</p>
<p>Adds the “<a class="reference external" href="File:Import:Import">File:Import:Import</a> Cisco Configuration” menu item. The plugin will:</p>
<ol class="arabic simple">
<li><p>Create a new node, under the current node, where the configuration will be written. This node will typically have references to several sections (see below).</p></li>
<li><p>Create sections (child nodes) for the indented blocks present in the original config file. These child nodes will have sub-nodes grouping similar blocks (e.g. there will be an ‘interface’ child node, with as many sub-nodes as there are real interfaces in the configuration file).</p></li>
<li><p>Create sections for the custom keywords specified in the customBlocks[] list in importCiscoConfig(). You can modify this list to specify different keywords. DO NOT put keywords that are followed by indented blocks (these are taken care of by point 2 above). The negated form of the keywords (for example, if the keyword is ‘service’, the negated form is ‘no service’) is also included in the sections.</p></li>
<li><p>Not display consecutive empty comment lines (lines with only a ‘!’).</p></li>
</ol>
<p>All created sections are alphabetically ordered.</p>
</section>
<section id="initinclass-py">
<h4><a class="toc-backref" href="#id14">initinclass.py</a><a class="headerlink" href="#initinclass-py" title="Permalink to this heading">¶</a></h4>
<p>Modifies the Python &#64;auto importer so that the importer puts the __init__ method (ctor) into the body of the class node.</p>
<p>This makes it easier to keep the instance variable docs in the class docstring in sync. with the ivars as manipulated by __init__, saves repeating explanations in both places.</p>
<p>Note that this is done <em>after</em> the consistency checks by the &#64;auto import code, so using this plugin is at your own risk.  It will change the order of declarations if other methods are declared before __init__.</p>
</section>
<section id="leofeeds-py">
<h4><a class="toc-backref" href="#id15">leofeeds.py</a><a class="headerlink" href="#leofeeds-py" title="Permalink to this heading">¶</a></h4>
<p>Reads from rss, atom or other sources.</p>
</section>
<section id="leomail-py">
<h4><a class="toc-backref" href="#id16">leomail.py</a><a class="headerlink" href="#leomail-py" title="Permalink to this heading">¶</a></h4>
<p>Sync local mailbox files over to Leo.</p>
</section>
<section id="leo-interface-py">
<h4><a class="toc-backref" href="#id17">leo_interface.py</a><a class="headerlink" href="#leo-interface-py" title="Permalink to this heading">¶</a></h4>
<p>Allows the user to browse XML documents in Leo.</p>
<p>This file implements an interface to XML generation, so that the resulting file can be processed by leo.</p>
</section>
<section id="linenumbers-py">
<h4><a class="toc-backref" href="#id18">lineNumbers.py</a><a class="headerlink" href="#linenumbers-py" title="Permalink to this heading">¶</a></h4>
<p>Adds #line directives in perl and perlpod programs.</p>
<p>Over-rides two methods in leoAtFile.py to write #line directives after node sentinels. This allows compilers to give locations of errors in relation to the node name rather than the filename. Currently supports only perl and perlpod.</p>
</section>
<section id="macros-py">
<h4><a class="toc-backref" href="#id19">macros.py</a><a class="headerlink" href="#macros-py" title="Permalink to this heading">¶</a></h4>
<p>Creates new nodes containing parameterized section reference.</p>
<p>This plugin adds nodes under the currently selected tree that are to act as section references. To do so, go the Outline menu and select the ‘Parameterize Section Reference’ command. This plugin looks for a top level node called ‘Parameterized Nodes’. If it finds a headline that matches the section reference it adds a node/nodes to the current tree.</p>
<p>To see this in action, do the following:</p>
<ol class="arabic" start="0">
<li><p><strong>Important</strong>: in the examples below, type &lt;&lt; instead of &lt; &lt; and
type &gt;&gt; instead of &gt; &gt;.  Docstrings can not contain section references!</p></li>
<li><p>Create a node called ‘Parameterized Nodes’, with a sub-node called  &lt; &lt; Meow &gt;&gt;.
The body of &lt; &lt; Meow &gt; &gt; should have the text:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>I mmmm sooo happy I could  &lt; &lt; 1$  &gt; &gt;.
But I don&#39;t know if I have all the  &lt; &lt; 2$  &gt; &gt;
money in the world.
</pre></div>
</div>
</li>
<li><p>In a node called A, type:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span> <span class="o">&lt;</span> <span class="n">meow</span><span class="p">(</span> <span class="n">purrrrrr</span><span class="p">,</span> <span class="n">zzooot</span> <span class="p">)</span>  <span class="o">&gt;</span> <span class="o">&gt;</span>
<span class="p">(</span><span class="n">leave</span> <span class="n">the</span> <span class="n">cursor</span> <span class="n">at</span> <span class="n">the</span> <span class="n">end</span> <span class="n">of</span> <span class="n">the</span> <span class="n">line</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p>In a node called B, type:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="o">&lt;</span> <span class="o">&lt;</span> <span class="n">meow</span> <span class="p">(</span> <span class="n">spit</span> <span class="ow">or</span> <span class="n">puke</span><span class="p">,</span> <span class="n">blinking</span>  <span class="p">)</span>  <span class="o">&gt;</span> <span class="o">&gt;</span>
<span class="p">(</span><span class="n">leave</span> <span class="n">the</span> <span class="n">cursor</span> <span class="n">at</span> <span class="n">the</span> <span class="n">end</span> <span class="n">of</span> <span class="n">the</span> <span class="n">line</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p>Leave the cursor in Node A at the designated point.</p></li>
<li><p>Go to Outline and select Parameterize Section Reference.</p></li>
</ol>
<p>The plugin searches the outline, goes to level one and finds a Node with the Headline, “Parameterized Nodes”. It looks for nodes under that headline with the the headline &lt;&lt; meow &gt;&gt;. It then creates this node structure under Node A:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>&lt; &lt; meow ( purrrrrr, zzooot ) &gt; &gt;
    &lt; &lt;2$&gt; &gt;
    &lt; &lt;1$&gt; &gt;
</pre></div>
</div>
<ol class="arabic" start="6">
<li><p>Examine the new subnodes of Node A:</p>
<blockquote>
<div><p>&lt; &lt; meow ( purrrrrr, zzooot ) &gt; &gt; contains the body text of the &lt; &lt; meow &gt; &gt; node.
&lt; &lt; 1$ &gt; &gt; contains the word purrrrrr.
&lt; &lt; 2$ &gt; &gt; contains the word zzooot.</p>
</div></blockquote>
</li>
<li><p>Go to Node B, and leave the cursor at the designated point.</p></li>
</ol>
<p>Go to Outline Menu and select Parameterize Section Reference command.</p>
<ol class="arabic simple" start="8">
<li><p>Examine the new subnodes of Node B.</p></li>
</ol>
<p>It’s a lot easier to use than to explain!</p>
</section>
<section id="markup-inline-py">
<h4><a class="toc-backref" href="#id20">markup_inline.py</a><a class="headerlink" href="#markup-inline-py" title="Permalink to this heading">¶</a></h4>
<p>Adds commands that create bold, italic or underlined text.</p>
</section>
<section id="mod-autosave-py">
<h4><a class="toc-backref" href="#id21">mod_autosave.py</a><a class="headerlink" href="#mod-autosave-py" title="Permalink to this heading">¶</a></h4>
<p>Autosaves the Leo outline every so often.</p>
<p>The time between saves is given by the setting, with default as shown:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@int</span> <span class="n">mod_autosave_interval</span> <span class="o">=</span> <span class="mi">300</span>
</pre></div>
</div>
<p>This plugin is active only if:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@bool</span> <span class="n">mod_autosave_active</span> <span class="o">=</span> <span class="kc">True</span>
</pre></div>
</div>
</section>
<section id="mod-read-dir-outline-py">
<h4><a class="toc-backref" href="#id22">mod_read_dir_outline.py</a><a class="headerlink" href="#mod-read-dir-outline-py" title="Permalink to this heading">¶</a></h4>
<p>Allows Leo to read a complete directory tree into a Leo outline. Converts directories into headlines and puts the list of file names into bodies.</p>
<p>Ce plug-in permet de traduire l’arborescence d’un répertoire en une arborescence Leo : Chaque dossier est converti en noeud dans Leo ; son nom est placé dans l’entête du noeud et chaque nom de fichier qu’il contient est listé dans son contenu.</p>
<p>Feedback on this plugin can be sent to:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Frédéric</span> <span class="n">Momméja</span>
<span class="o">&lt;</span><span class="n">frederic</span> <span class="p">[</span><span class="n">point</span><span class="p">]</span> <span class="n">mommeja</span> <span class="p">[</span><span class="n">at</span><span class="p">]</span> <span class="n">laposte</span> <span class="p">[</span><span class="n">point</span><span class="p">]</span> <span class="n">net</span><span class="o">&gt;</span>
</pre></div>
</div>
</section>
<section id="mod-timestamp-py">
<h4><a class="toc-backref" href="#id23">mod_timestamp.py</a><a class="headerlink" href="#mod-timestamp-py" title="Permalink to this heading">¶</a></h4>
<p>Timestamps all save operations to show when they occur.</p>
</section>
<section id="nodeactions-py">
<h4><a class="toc-backref" href="#id24">nodeActions.py</a><a class="headerlink" href="#nodeactions-py" title="Permalink to this heading">¶</a></h4>
<p>Allows the definition of double-click actions.</p>
<p>When the user double-clicks a node this plugin checks for a match of the clicked node’s headline text with a list of patterns. If a match occurs, the plugin executes the associated script.</p>
<p><strong>nodeAction</strong> nodes may be located anywhere in the outline. Such nodes should contain one or more <strong>pattern nodes</strong> as children. The headline of each pattern node contains the pattern; the body text contains the script to be executed when the pattern matches the double-clicked node.</p>
<p>For example, the “nodeActions” node containing a “launch URL” pattern node and a “pre-process python code” node could be placed under an “&#64;settings” node:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@settings</span>
<span class="o">|</span>
<span class="o">+-</span> <span class="n">nodeActions</span>
   <span class="o">|</span>
   <span class="o">+-</span> <span class="n">http</span><span class="p">:</span>\\<span class="o">*</span>
   <span class="o">|</span>
   <span class="o">+-</span> <span class="nd">@file</span> <span class="o">*.</span><span class="n">py</span>
</pre></div>
</div>
<p><strong>Configuration</strong></p>
<p>The nodeActions plugin supports the following global configurations using Leo’s support for setting global variables within an &#64;settings node’s sub-nodes in the leoSettings.leo, myLeoSettings.leo, and the project Leo file:</p>
<p>&#64;bool nodeActions_save_atFile_nodes = False</p>
<blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">True</dt>
<dd class="field-odd"><p>Double-click on an &#64;file type node will save the file to disk
before executing the script.</p>
</dd>
<dt class="field-even">False</dt>
<dd class="field-even"><p>Double-click on an &#64;file type node will <strong>not</strong> save the file to disk
before executing the script. (default)</p>
</dd>
</dl>
</div></blockquote>
<p>&#64;int nodeActions_message_level = 1</p>
<blockquote>
<div><p>Specifies the type of messages to be sent to the log pane.  Specifying a
higher message level will display that level and all lower levels.
The following integer values are supported:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">0</span> <span class="n">no</span> <span class="n">messages</span>
<span class="mi">1</span> <span class="n">Plugin</span> <span class="n">triggered</span> <span class="ow">and</span> <span class="n">the</span> <span class="n">patterns</span> <span class="n">that</span> <span class="n">were</span> <span class="n">matched</span> <span class="p">(</span><span class="n">default</span><span class="p">)</span>
<span class="mi">2</span> <span class="n">Double</span><span class="o">-</span><span class="n">click</span> <span class="n">event</span> <span class="n">passed</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">to</span> <span class="nb">next</span> <span class="n">plugin</span>
<span class="mi">3</span> <span class="n">Patterns</span> <span class="n">that</span> <span class="n">did</span> <span class="ow">not</span> <span class="n">match</span>
<span class="mi">4</span> <span class="n">Code</span> <span class="n">debugging</span> <span class="n">messages</span>
</pre></div>
</div>
</div></blockquote>
<p><strong>Patterns</strong></p>
<p>Pattern matching is performed using python’s support for Unix shell-style patterns unless overwritten by the “X” pattern directive. The following pattern elements are supported:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>*           matches everything
?           matches any single character
[&lt;seq&gt;]     matches any character in &lt;seq&gt;
[!&lt;seq&gt;]    matches any character **not** in &lt;seq&gt;
</pre></div>
</div>
<p>Unix shell-style pattern matching is case insensitive and always starts from the beginning of the headline.  For example:</p>
<blockquote>
<div><table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 34%" />
<col style="width: 44%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Pattern</p></th>
<th class="head"><p>Matches</p></th>
<th class="head"><p>Does not match</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>*.py</p></td>
<td><p>Abc_Test.py</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>.py</p></td>
<td><p>.py - Test</p></td>
<td><p>Abc_Test.py</p></td>
</tr>
<tr class="row-even"><td><p>test*</p></td>
<td><p>Test_Abc.py</p></td>
<td><p>Abc_Test.py</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>To enable a script to run on any type of &#64;file node (&#64;thin, &#64;shadow, …), the pattern can start with “&#64;files” to match on any external file type.  For example, the pattern “&#64;files *.py” will match a node with the headline “&#64;file abcd.py”.</p>
<p>The headline of the double-clicked node is matched against the patterns starting from the first sub-node under the “nodeActions” node to the last sub-node.</p>
<p>Only the script associated with the first matching pattern is invoked unless overwritten by the “V” pattern directive.</p>
<p>Using the “V” pattern directive allows a broad pattern such as “&#64;files *.py” to be invoked, and then, by placing a more restrictive pattern above it, such as “&#64;files *_test.py”, a different script can be executed for those files requiring pre-processing:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">+-</span> <span class="n">nodeActions</span>
   <span class="o">|</span>
   <span class="o">+-</span> <span class="nd">@files</span> <span class="o">*</span><span class="n">_test</span><span class="o">.</span><span class="n">py</span>
   <span class="o">|</span>
   <span class="o">+-</span> <span class="nd">@files</span> <span class="o">*.</span><span class="n">py</span>
</pre></div>
</div>
<p><strong>Note</strong>: To prevent Leo from trying to save patterns that begin with a derived file directive (&#64;file, &#64;auto, …) to disk, such as “&#64;file *.py”, place the “&#64;ignore” directive in the body of the “nodeActions” node.</p>
<p>Pattern nodes can be placed at any level under the “nodeActions” node. Only nodes with no child nodes are considered pattern nodes. This allows patterns that are to be used in multiple Leo files to be read from a file.  For example, the following structure reads the pattern definition from the “C:\Leo\nodeActions_Patterns.txt” file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">+-</span> <span class="n">nodeActions</span>
<span class="o">|</span>
<span class="o">+-</span> <span class="nd">@files</span> <span class="n">C</span><span class="p">:</span>\\<span class="n">Leo</span>\\<span class="n">nodeActions_Patterns</span><span class="o">.</span><span class="n">txt</span>
    <span class="o">|</span>
    <span class="o">+-</span> <span class="n">http</span><span class="p">:</span>\\<span class="o">*</span>
    <span class="o">|</span>
    <span class="o">+-</span> <span class="nd">@file</span> <span class="o">*.</span><span class="n">py</span>
</pre></div>
</div>
<p><strong>Pattern directives</strong></p>
<p>The following pattern specific directives can be appended to the end of a pattern (do not include the ‘:’):</p>
<dl class="field-list">
<dt class="field-odd">[X]</dt>
<dd class="field-odd"><p>Use python’s regular expression type patterns instead of the Unix
shell-style pattern syntax.</p>
<p>For example, the following patterns will match the same headline string:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>Unix shell-style pattern:
   @files *.py

Regular Expression pattern:
   ^@files .*\.py$ [X]
</pre></div>
</div>
</dd>
<dt class="field-even">[V]</dt>
<dd class="field-even"><p>Matching the pattern will not block the double-click event from
being passed to the remaining patterns.
The “V” represents a down arrow that symbolizes the passing of the event
to the next pattern below it.</p>
<p>For example, adding the “[V]” directive to the “&#64;files *_test.py” in
the Patterns section above, changes its script from being ‘an
alternate to’ to being ‘a pre-processor for’ the “&#64;files *.py” script:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">+-</span> <span class="n">nodeActions</span>
   <span class="o">|</span>
   <span class="o">+-</span> <span class="nd">@files</span> <span class="o">*</span><span class="n">_test</span><span class="o">.</span><span class="n">py</span> <span class="p">[</span><span class="n">V</span><span class="p">]</span>
   <span class="o">|</span>
   <span class="o">+-</span> <span class="nd">@files</span> <span class="o">*.</span><span class="n">py</span>
</pre></div>
</div>
</dd>
<dt class="field-odd">[&gt;]</dt>
<dd class="field-odd"><p>Matching the pattern will not block the double-click event from being
passed to other plugins.
The “&gt;” represents a right arrow that
symbolizes the passing of the event to the next plugin.</p>
<p>If the headline matched more than one headline,
the double-click event will be passed to the next plugin if the
directive is associated with any of the matched patterns.</p>
</dd>
</dl>
<p>The directive(s) for a pattern must be contained within a single set of brackets, separated from the pattern by a space, with or without a comma separator.  For example, the following specifies all three directives:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>^@files .*\.py$ [X,V&gt;]
</pre></div>
</div>
<p><strong>Scripts</strong></p>
<p>The script for a pattern is located in the body of the pattern’s node. The following global variables are available to the script:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">c</span>
<span class="n">g</span>
<span class="n">pClicked</span> <span class="o">-</span> <span class="n">node</span> <span class="n">position</span> <span class="n">of</span> <span class="n">the</span> <span class="n">double</span><span class="o">-</span><span class="n">clicked</span> <span class="n">node</span>
<span class="n">pScript</span> <span class="o">-</span> <span class="n">node</span> <span class="n">position</span> <span class="n">of</span> <span class="n">the</span> <span class="n">invoked</span> <span class="n">script</span>
</pre></div>
</div>
<p><strong>Examples</strong></p>
<p>Double-clicking on a node with a “http:\\www.google.com” headline will invoke the script associated with the “http:\\*” pattern.  The following script in the body of the pattern’s node displays the URL in a browser:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">webbrowser</span>
<span class="n">hClicked</span> <span class="o">=</span> <span class="n">pClicked</span><span class="o">.</span><span class="n">h</span>     <span class="c1">#Clicked node&#39;s Headline text</span>
<span class="n">webbrowser</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">hClicked</span><span class="p">)</span> <span class="c1">#Invoke browser</span>
</pre></div>
</div>
<p>The following script can be placed in the body of a pattern’s node to execute a command in the first line of the body of a double-clicked node:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">g</span><span class="o">.</span><span class="n">os</span><span class="o">.</span><span class="n">system</span><span class="p">(</span><span class="s1">&#39;&quot;Start /b &#39;</span> <span class="o">+</span> <span class="n">pClicked</span><span class="o">.</span><span class="n">bodyString</span><span class="p">()</span> <span class="o">+</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="nodediff-py">
<h4><a class="toc-backref" href="#id25">nodediff.py</a><a class="headerlink" href="#nodediff-py" title="Permalink to this heading">¶</a></h4>
<p>Provides commands to run text diffs on node bodies within Leo.</p>
</section>
<section id="outline-export-py">
<h4><a class="toc-backref" href="#id26">outline_export.py</a><a class="headerlink" href="#outline-export-py" title="Permalink to this heading">¶</a></h4>
<p>Modifies the way exported outlines are written.</p>
</section>
<section id="paste-as-headlines-py">
<h4><a class="toc-backref" href="#id27">paste_as_headlines.py</a><a class="headerlink" href="#paste-as-headlines-py" title="Permalink to this heading">¶</a></h4>
<p>Creates new headlines from clipboard text.</p>
<p>If the pasted text would be greater than 50 characters in length, the plugin truncates the headline to 50 characters and pastes the entire line into the body text of that node. Creates a “Paste as Headlines” option the Edit menu directly under the existing Paste option.</p>
</section>
<section id="quickmove-py">
<h4><a class="toc-backref" href="#id28">quickMove.py</a><a class="headerlink" href="#quickmove-py" title="Permalink to this heading">¶</a></h4>
<p>Creates buttons to move nodes quickly to other nodes.</p>
<p>Quickly move/copy/clone nodes from around the tree to one or more target nodes. It can also create bookmark and tagging functionality in an outline (see <cite>Set Parent Notes</cite> below).</p>
<p>Adds <cite>Move/Clone/Copy To Last Child Button</cite> and <cite>Move/Clone/Copy To First Child Button</cite>, <cite>Link To/From</cite> and <cite>Jump To</cite> commands to the Move sub-menu on the Outline menu, and each node’s context menu, if the <cite>contextmenu</cite> plugin is enabled.</p>
<p>Select a node <code class="docutils literal notranslate"><span class="pre">Foo</span></code> and then use the <cite>Move To Last Child Button</cite> command. This adds a ‘to Foo’ button to the button bar. Now select another node and click the ‘to Foo’ button. The selected node will be moved to the last child of the node ‘Foo’.</p>
<p><cite>To First Child Button</cite> works the same way, except that moved nodes are inserted as the first child of the target node.</p>
<p><cite>Clone</cite> and <cite>Copy</cite> variants are like <cite>Move</cite>, but clone or copy instead of moving.</p>
<p><cite>Link</cite> works in conjunction with the <cite>backlink</cite> plugin (and also the <cite>graphcanvas</cite> plugin) creating a link to/from the target and current nodes.</p>
<p><cite>Jump</cite> buttons act as bookmarks, taking you to the target node.</p>
<p>You can right click on any of these buttons to access their context menu:</p>
<blockquote>
<div><dl class="simple">
<dt>Goto Target</dt><dd><p>takes you to the target node (like a <cite>Jump</cite> button).</p>
</dd>
<dt>Make Permanent</dt><dd><p>makes the button permanent, it will reappear
when the file is saved / closed / re-opened.</p>
</dd>
<dt>Set Parent</dt><dd><p>allows you to move buttons to sub-menu items of other
<cite>quickMove</cite> buttons.  This implicitly makes the moved button
permanent.  It also causes the moved button to lose its context menu.</p>
</dd>
<dt>Remove Button</dt><dd><p>comes from the <cite>mod_scripting</cite> plugin, and just
removes the button for the rest of the current session.</p>
</dd>
</dl>
</div></blockquote>
<dl>
<dt>Set Parent Notes</dt><dd><p><cite>Set Parent</cite> doesn’t allow you to do anything with <cite>quickMove</cite> you couldn’t
do with a long strip of separate buttons, but it collects quickMove buttons
as sub-menu items of one quickMove button, saving a lot of toolbar space.</p>
</dd>
<dt>Bookmarks</dt><dd><p>Create somewhere out of the way in your outline a node called
<cite>Bookmarks</cite>. Use the quickMove menu to make it a <cite>Jump To</cite> button, and use its
context menu to make it permanent. There is no particular reason to jump to
it, but it needs to be a <cite>quickMove</cite> button of some kind.</p>
<p>Now, when you want to bookmark a node, first use the quickMove menu to make
the node a <cite>Jump To</cite> button, and then use the context menu on the button to
set its parent to your <cite>Bookmarks</cite> button.  It becomes a sub-menu item
of the <cite>Bookmarks</cite> button.</p>
</dd>
<dt>Tags</dt><dd><p>In conjunction with the <cite>backlinks</cite> plugin you can use <cite>quickMove</cite> to
tag nodes.   The <cite>backlinks</cite> plugin adds a <cite>Links</cite> tab to the <cite>Log pane</cite>.</p>
<p>Create somewhere in your outline a node called <cite>Tags</cite>. Use the quickMove menu
to make it a <cite>Jump To</cite> button, and use its context menu to make it permanent.
Clicking on it will jump you to your tag list. Now create a node under the
<cite>Tags</cite> node for each tag you want. The node’s name will be the tag name, and
can be changed later. Then use the quickMove menu to make each of these nodes
a <cite>Link To</cite> button, and then use the context menu on the button to set its
parent to your <cite>Tags</cite> button. It becomes a sub-menu item of the <cite>Tags</cite> button.</p>
<p>To see the tags on a node, you need to be looking at the <cite>Links</cite> tab in the
<cite>Log pane</cite>.  To see all the nodes with a particular tag, click on the <cite>Tags</cite>
button to jump to the tag list, and select the node which names the tag of
interest.  The nodes with that tag will be listed in the <cite>Links</cite> tab in the
<cite>Log pane</cite>.</p>
</dd>
</dl>
</section>
<section id="sethomedirectory-py">
<h4><a class="toc-backref" href="#id29">setHomeDirectory.py</a><a class="headerlink" href="#sethomedirectory-py" title="Permalink to this heading">¶</a></h4>
<p>Sets g.app.homeDir to a hard-coded path.</p>
</section>
<section id="sftp-py">
<h4><a class="toc-backref" href="#id30">sftp.py</a><a class="headerlink" href="#sftp-py" title="Permalink to this heading">¶</a></h4>
<p>Adds &#64;edit-like functionality for remote files over SFTP.</p>
</section>
<section id="threadutil-py">
<h4><a class="toc-backref" href="#id31">threadutil.py</a><a class="headerlink" href="#threadutil-py" title="Permalink to this heading">¶</a></h4>
<p>Adds utilities for asynchronous operation of commands.</p>
</section>
<section id="word-count-py">
<h4><a class="toc-backref" href="#id32">word_count.py</a><a class="headerlink" href="#word-count-py" title="Permalink to this heading">¶</a></h4>
<p>Counts characters, words, lines, and paragraphs in the body pane.</p>
<p>It adds a “Word Count…” option to the bottom of the Edit menu that will activate the command.</p>
</section>
<section id="xml-edit">
<h4><a class="toc-backref" href="#id33">xml_edit</a><a class="headerlink" href="#xml-edit" title="Permalink to this heading">¶</a></h4>
<p>Adds commands for importing and exporting xml to and from Leo outlines.</p>
</section>
</section>
<section id="debugging">
<h3><a class="toc-backref" href="#id34">Debugging</a><a class="headerlink" href="#debugging" title="Permalink to this heading">¶</a></h3>
<section id="debugger-pudb-py">
<h4><a class="toc-backref" href="#id35">debugger_pudb.py</a><a class="headerlink" href="#debugger-pudb-py" title="Permalink to this heading">¶</a></h4>
<p>Makes g.pdb() enter the Pudb debugger instead of pdb.</p>
<p>Pudb is a full-screen Python debugger: <a class="reference external" href="http://pypi.python.org/pypi/pudb">http://pypi.python.org/pypi/pudb</a></p>
</section>
<section id="dump-globals-py">
<h4><a class="toc-backref" href="#id36">dump_globals.py</a><a class="headerlink" href="#dump-globals-py" title="Permalink to this heading">¶</a></h4>
<p>Dumps Python globals at startup.</p>
</section>
<section id="enable-gc-py">
<h4><a class="toc-backref" href="#id37">enable_gc.py</a><a class="headerlink" href="#enable-gc-py" title="Permalink to this heading">¶</a></h4>
<p>Enables debugging and tracing for Python’s garbage collector.</p>
</section>
<section id="quit-leo-py">
<h4><a class="toc-backref" href="#id38">quit_leo.py</a><a class="headerlink" href="#quit-leo-py" title="Permalink to this heading">¶</a></h4>
<p>Shows how to force Leo to quit.</p>
</section>
<section id="trace-gc-plugin-py">
<h4><a class="toc-backref" href="#id39">trace_gc_plugin.py</a><a class="headerlink" href="#trace-gc-plugin-py" title="Permalink to this heading">¶</a></h4>
<p>Traces changes to Leo’s objects at idle time.</p>
</section>
<section id="trace-keys-py">
<h4><a class="toc-backref" href="#id40">trace_keys.py</a><a class="headerlink" href="#trace-keys-py" title="Permalink to this heading">¶</a></h4>
<p>Traces keystrokes in the outline and body panes.</p>
</section>
<section id="trace-tags-py">
<h4><a class="toc-backref" href="#id41">trace_tags.py</a><a class="headerlink" href="#trace-tags-py" title="Permalink to this heading">¶</a></h4>
<p>Traces most common hooks, but not key, drag or idle hooks.</p>
</section>
</section>
<section id="external-programs">
<h3><a class="toc-backref" href="#id42">External programs</a><a class="headerlink" href="#external-programs" title="Permalink to this heading">¶</a></h3>
<section id="ipython-py">
<h4><a class="toc-backref" href="#id43">ipython.py</a><a class="headerlink" href="#ipython-py" title="Permalink to this heading">¶</a></h4>
<p>Creates a two-way communication (bridge) between Leo scripts and IPython running in the console from which Leo was launched.</p>
<p>Using this bridge, scripts running in Leo can affect IPython, and vice versa. In particular, scripts running in IPython can alter Leo outlines!</p>
<p>For full details, see the <cite>IPython Bridge Guide</cite>.</p>
</section>
<section id="open-shell-py">
<h4><a class="toc-backref" href="#id44">open_shell.py</a><a class="headerlink" href="#open-shell-py" title="Permalink to this heading">¶</a></h4>
<p>Creates an ‘Extensions’ menu containing two commands: Open Console Window and Open Explorer.</p>
<p>The Open Console Window command opens xterm on Linux. The Open Explorer command Opens a Windows explorer window.</p>
<p>This allows quick navigation to facilitate testing and navigating large systems with complex directories.</p>
<p>Please submit bugs / feature requests to <a class="reference external" href="mailto:etaekema&#37;&#52;&#48;earthlink&#46;net">etaekema<span>&#64;</span>earthlink<span>&#46;</span>net</a></p>
<p>Current limitations:
- Not tested on Mac OS X …
- On Linux, xterm must be in your path.</p>
</section>
<section id="tomboy-import-py">
<h4><a class="toc-backref" href="#id45">tomboy_import.py</a><a class="headerlink" href="#tomboy-import-py" title="Permalink to this heading">¶</a></h4>
<p>Allows imports of notes created in Tomboy / gnote.</p>
<p>Usage:</p>
<ul class="simple">
<li><p>Create a node with the headline ‘tomboy’</p></li>
<li><p>Select the node, and do alt+x act-on-node</p></li>
<li><p>The notes will appear as children of ‘tomboy’ node</p></li>
<li><p>The next time you do act-on-node, existing notes will be updated (they don’t need to
be under ‘tomboy’ node anymore) and new notes added.</p></li>
</ul>
</section>
<section id="vim-py">
<h4><a class="toc-backref" href="#id46">vim.py</a><a class="headerlink" href="#vim-py" title="Permalink to this heading">¶</a></h4>
<p>Enables two-way communication with gvim (recommended) or vim. with the following commands:</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">vim-open-file</span></code></dt><dd><p>Opens the nearest ancestor &#64;file or &#64;clean node in vim. Leo will update
the file in the outline when you save the file in vim.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">vim-open-node</span></code></dt><dd><p>Opens the selected node in vim. Leo will update the node in the outline
when you save the file in vim.</p>
</dd>
</dl>
</section>
<section id="xemacs-py">
<h4><a class="toc-backref" href="#id47">xemacs.py</a><a class="headerlink" href="#xemacs-py" title="Permalink to this heading">¶</a></h4>
<p>Allows you to edit nodes in emacs/xemacs.</p>
<p>Depending on your preference, selecting or double-clicking a node will pass the body text of that node to emacs. You may edit the node in the emacs buffer and changes will appear in Leo.</p>
</section>
<section id="word-export-py">
<h4><a class="toc-backref" href="#id48">word_export.py</a><a class="headerlink" href="#word-export-py" title="Permalink to this heading">¶</a></h4>
<p>Adds the Plugins:Word Export:Export menu item to format and export the selected outline to a Word document, starting Word if necessary.</p>
</section>
</section>
<section id="files-and-nodes">
<h3><a class="toc-backref" href="#id49">Files and nodes</a><a class="headerlink" href="#files-and-nodes" title="Permalink to this heading">¶</a></h3>
<section id="active-path-py">
<h4><a class="toc-backref" href="#id50">active_path.py</a><a class="headerlink" href="#active-path-py" title="Permalink to this heading">¶</a></h4>
<p>Synchronizes &#64;path nodes with folders.</p>
<p>If a node is named <a class="reference external" href="mailto:'&#37;&#52;&#48;path">‘<span>&#64;</span>path</a> path_to_folder’, the content (file and folder names) of the folder and the children of that node will synchronized whenever the node’s status-iconbox is double clicked.</p>
<p>For files not previously seen in a folder a new node will appear on top of the children list (with a mark).</p>
<p>Folders appear in the list as /foldername/. If you double click on the icon-box of the folder node, it will have children added to it based on the contents of the folder on disk. These folders have the <a class="reference external" href="mailto:'&#37;&#52;&#48;path">‘<span>&#64;</span>path</a>’ directive as the first line of their body text.</p>
<p>When files are deleted from the folder and the list is updated by double clicking the files will appear in the list as <em>filename</em> (or <em>/foldername/</em>).</p>
<p>You can describe files and directories in the body of the nodes.</p>
<p>You can organize files and directories with organizer nodes, an organizer node name cannot contain with ‘/’.</p>
<p>Files and folders can be created by entering a node with the required name as its headline (must start and/or end with “/” for a folder) and then double clicking on the node’s status-iconbox.</p>
<p>&#64;auto nodes can be set up for existing files can be loaded by double clicking on the node’s status-iconbox. If you prefer &#64;shadow or something else use the “active_path_attype” setting, without the “&#64;”.</p>
<p>There are commands on the Plugins active_path submenu:</p>
<ul class="simple">
<li><p>show path - show the current path</p></li>
<li><p>set absolute path - changes a node “/dirname/” to “&#64;path /absolute/path/to/dirname”.</p></li>
<li><p>purge vanished (recursive) - remove <em>entries</em></p></li>
<li><p>update recursive - recursive load of directories, use with caution on large
file systems</p></li>
</ul>
<p>If you want to use an input other than double clicking a node’s status-iconbox set active_path_event to a value like ‘iconrclick1’ or ‘iconclick1’.</p>
<p>There are &#64;settings for ignoring directory entries and automatically loading files.  <code class="docutils literal notranslate"><span class="pre">re.search</span></code> is used, rather than <code class="docutils literal notranslate"><span class="pre">re.match</span></code>, so patterns need only match part of the filename, not the whole filename.</p>
<p>The body of the &#64;setting <code class="docutils literal notranslate"><span class="pre">&#64;data</span> <span class="pre">active_path_ignore</span></code> is a list of regex patterns, one per line.  Directory entries matching any pattern in the list will be ignored.  The names of directories used for matching will have forward slashes around them (‘/dirname/’), so patterns can use this to distinguish between directories and files.</p>
<p>The body of the &#64;setting <code class="docutils literal notranslate"><span class="pre">&#64;data</span> <span class="pre">active_path_autoload</span></code> is a list of regex patterns, one per line.  File entries matching any pattern in the list will be loaded automatically.  This works only with files, not directories (but you can load directories recursively anyway).</p>
<p>Set <code class="docutils literal notranslate"><span class="pre">&#64;bool</span> <span class="pre">active_path_load_docstring</span> <span class="pre">=</span> <span class="pre">True</span></code> to have active_path load the docstring of .py files automatically.  These nodes start with the special string:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@language</span> <span class="n">rest</span> <span class="c1"># AUTOLOADED DOCSTRING</span>
</pre></div>
</div>
<p>which must be left intact if you want active path to be able to double-click load the file later.</p>
<p>&#64;float active_path_timeout_seconds (default 10.) controls the maximum time active_path will spend on a recursive operation.</p>
<p>&#64;int active_path_max_size (default 1000000) controls the maximum size file active_path will open without query.</p>
<p>active_path is a rewrite of the at_directory plugin to use &#64;path directives (which influence &#64;auto and other &#64;file type directives), and to handle sub-folders more automatically.</p>
</section>
<section id="at-folder-py">
<h4><a class="toc-backref" href="#id51">at_folder.py</a><a class="headerlink" href="#at-folder-py" title="Permalink to this heading">¶</a></h4>
<p>Synchronizes &#64;folder nodes with folders.</p>
<p>If a node is named <a class="reference external" href="mailto:'&#37;&#52;&#48;folder">‘<span>&#64;</span>folder</a> path_to_folder’, the content (filenames) of the folder and the children of that node will be sync. Whenever a new file is put there, a new node will appear on top of the children list (with mark). So that I can put my description (i.e. annotation) as the content of that node. In this way, I can find any files much easier from leo.</p>
<p>Moreover, I add another feature to allow you to group files(in leo) into children of another group. This will help when there are many files in that folder. You can logically group it in leo (or even clone it to many groups), while keep every files in a flat/single directory on your computer.</p>
</section>
<section id="at-produce-py">
<h4><a class="toc-backref" href="#id52">at_produce.py</a><a class="headerlink" href="#at-produce-py" title="Permalink to this heading">¶</a></h4>
<p>Executes commands in nodes whose body text starts with &#64;produce.</p>
<p>WARNING: trying to execute a non-existent command will hang Leo.</p>
<p>To use, put in the body text of a node:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@produce</span> <span class="n">echo</span> <span class="n">hi</span>
</pre></div>
</div>
<p>This plugin creates two new commands: at-produce-all and at-produce-selected.</p>
<p>at-produce-all scans the entire tree for body text containing &#64;produce. at-produce-selected just scans the selected tree.</p>
<p>Whatever follows &#64;produce is executed as a command.</p>
<p>&#64;produce commands are executed in the order they are found, that is, in outline order.</p>
<p>The at-produce commands produce a log node as the last top-level node of the outline. Any output, including error messages, should be there.</p>
<p>This plugin is not intended as a replacement for make or Ant, but as a simple substitute when that machinery is overkill.</p>
</section>
<section id="at-view-py">
<h4><a class="toc-backref" href="#id53">at_view.py</a><a class="headerlink" href="#at-view-py" title="Permalink to this heading">¶</a></h4>
<p>Adds support for &#64;clip, &#64;view and &#64;strip nodes.</p>
<ul class="simple">
<li><p>Selecting a headline containing &#64;clip appends the contents of the clipboard to
the end of the body pane.</p></li>
<li><p>Double clicking the icon box of a node whose headline contains &#64;view
<em>&lt;path-to-file&gt;</em> places the contents of the file in the body pane.</p></li>
<li><p>Double clicking the icon box of a node whose headline contains &#64;strip
<em>&lt;path-to-file&gt;</em> places the contents of the file in the body pane, with all
sentinels removed.</p></li>
</ul>
<p>This plugin also accumulates the effect of all &#64;path nodes.</p>
</section>
<section id="backlink-py">
<h4><a class="toc-backref" href="#id54">backlink.py</a><a class="headerlink" href="#backlink-py" title="Permalink to this heading">¶</a></h4>
<p>Allows arbitrary links between nodes.</p>
</section>
<section id="datenodes-py">
<h4><a class="toc-backref" href="#id55">datenodes.py</a><a class="headerlink" href="#datenodes-py" title="Permalink to this heading">¶</a></h4>
<p>Allows users to insert headlines containing dates.</p>
<p>‘Date nodes’ are nodes that have dates in their headlines. They may be added to the outline one at a time, a month’s-worth at a time, or a year’s-worth at a time. The format of the labels (headlines) is configurable.</p>
<p>There are options to omit Saturdays and Sundays.</p>
<p>An ‘Insert Date Nodes …’ submenu will be created (by default) in the ‘Outline’ menu.  This menu can be suppressed by using either of the following settings:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span> <span class="nd">@bool</span> <span class="n">suppress</span><span class="o">-</span><span class="n">datenodes</span><span class="o">-</span><span class="n">menus</span>
<span class="o">-</span> <span class="nd">@bool</span> <span class="n">suppress</span><span class="o">-</span><span class="nb">all</span><span class="o">-</span><span class="n">plugins</span><span class="o">-</span><span class="n">menus</span>
</pre></div>
</div>
<p>The following commands are available for use via the minibuffer or in &#64;menu/&#64;popup settings:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span> <span class="n">datenodes</span><span class="o">-</span><span class="n">today</span>
<span class="o">-</span> <span class="n">datenodes</span><span class="o">-</span><span class="n">this</span><span class="o">-</span><span class="n">month</span>
<span class="o">-</span> <span class="n">datenodes</span><span class="o">-</span><span class="n">this</span><span class="o">-</span><span class="n">year</span>
</pre></div>
</div>
</section>
<section id="expfolder-py">
<h4><a class="toc-backref" href="#id56">expfolder.py</a><a class="headerlink" href="#expfolder-py" title="Permalink to this heading">¶</a></h4>
<p>Adds &#64;expfolder nodes that represent folders in the file system.</p>
<p>Double clicking on the icon of an &#64;expfolder heading reads the files in the directory at the path specified and creates child nodes for each file in the subfolder. Subdirectories are made into child &#64;expfolder nodes so the tree can be easily traversed. If files have extensions specified in the expfolder.ini file they are made into &#64;text nodes so the content of the files can be easily loaded into leo and edited. Double clicking a second time will delete all child nodes and refresh the directory listing. If there are any changed &#64;text nodes contained inside you will be prompted about saving them.</p>
<p>The textextensions field on the expfolder Properties page contains a list of extensions which will be made into &#64;text nodes, separated by spaces.</p>
<p>For the &#64;text and &#64;expfolder nodes to interact correctly, the textnode plugin must load before the expfolder plugin. This can be set using the Plugin Manager’s Plugin Load Order pane.</p>
</section>
<section id="fileactions-py">
<h4><a class="toc-backref" href="#id57">FileActions.py</a><a class="headerlink" href="#fileactions-py" title="Permalink to this heading">¶</a></h4>
<p>Defines actions taken when double-clicking on &#64;&lt;file&gt; nodes and supports &#64;file-ref nodes.</p>
<p>Double-clicking any kind of &#64;&lt;file&gt; node writes out the file if changes have been made since the last save, and then runs a script on it, which is retrieved from the outline.</p>
<p>Scripts are located in a node whose headline is FileActions. This node can be anywhere in the outline. If there is more than one such node, the first one in outline order is used.</p>
<p>The children of that node are expected to contain a file pattern in the headline and the script to be executed in the body. The file name is matched against the patterns (which are Unix-style shell patterns), and the first matching node is selected. If the filename is a path, only the last item is matched.</p>
<p>Execution of the scripts is similar to the “Execute Script” command in Leo. The main difference is that the namespace in which the scripts are run contains these elements:</p>
<ul class="simple">
<li><p>‘c’ and ‘g’ and ‘p’: as in the regular execute script command.</p></li>
<li><p>‘filename’: the filename from the &#64;file directive.</p></li>
<li><p>‘shellScriptInWindow’, a utility function that runs a shell script in an external windows, thus permitting programs to be called that require user interaction</p></li>
</ul>
<p>File actions are implemented for all kinds &#64;&lt;file&gt; nodes. There is also a new node type &#64;file-ref for referring to files purely for the purpose of file actions, Leo does not do anything with or to such files.</p>
</section>
<section id="geotag-py">
<h4><a class="toc-backref" href="#id58">geotag.py</a><a class="headerlink" href="#geotag-py" title="Permalink to this heading">¶</a></h4>
<p>Tags nodes with latitude and longitude.</p>
</section>
<section id="injarnder-py">
<h4><a class="toc-backref" href="#id59">injarnder.py</a><a class="headerlink" href="#injarnder-py" title="Permalink to this heading">¶</a></h4>
<p>Renders &#64;jinja nodes.</p>
</section>
<section id="leocursor-py">
<h4><a class="toc-backref" href="#id60">leocursor.py</a><a class="headerlink" href="#leocursor-py" title="Permalink to this heading">¶</a></h4>
<p>Creates a LeoCursor object that can walk around a Leo outline and decode attributes from nodes.</p>
<p>Node names can be used through . (dot) notation so <code class="docutils literal notranslate"><span class="pre">cursor.Data.Name._B</span></code> for example returns the body text of the Name node which is a child of the Data node which is a child of the cursors current location.</p>
<p>See …/plugins/examples/leocursorexample.leo for application.</p>
</section>
<section id="leoopml-py">
<h4><a class="toc-backref" href="#id61">leoOPML.py</a><a class="headerlink" href="#leoopml-py" title="Permalink to this heading">¶</a></h4>
<p>Read and write .leo files in ` OPML &lt;<a class="reference external" href="https://en.wikipedia.org/wiki/OPML">https://en.wikipedia.org/wiki/OPML</a>&gt;`_.</p>
</section>
<section id="mime-py">
<h4><a class="toc-backref" href="#id62">mime.py</a><a class="headerlink" href="#mime-py" title="Permalink to this heading">¶</a></h4>
<p>Opens files with their default platform program.</p>
<p>Double-clicking &#64;mime nodes will attempt to open the named file as if opened from a file manager. &#64;path parent nodes are used to find the full filename path.  Fore example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@mime</span> <span class="n">foodir</span><span class="o">/</span><span class="n">document</span><span class="o">.</span><span class="n">pdf</span>
</pre></div>
</div>
<p>The string setting ‘mime_open_cmd’ allows specifying a program to handle opening files:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@settings</span>
    <span class="nd">@string</span> <span class="n">mime_open_cmd</span> <span class="o">=</span> <span class="n">see</span>
    <span class="o">..</span> <span class="ow">or</span> <span class="o">..</span>
    <span class="nd">@string</span> <span class="n">mime_open_cmd</span> <span class="o">=</span> <span class="n">see</span> <span class="o">%</span><span class="n">s</span>
</pre></div>
</div>
<p>Where ‘%s’ is replaced with the full pathname.</p>
<p><strong>Note</strong>: This plugin terminates handling of the ‘icondclick1’ event by returning True. If another plugin using this event (e.g. vim.py) is also enabled, the order in &#64;enabled-plugins matters. For example: if vim.py is enabled before mime.py, double-clicking on an &#64;mime node will both open the body text in [g]vim AND call the mime_open_cmd.</p>
<p>This plugin is complementary to the UNL.py plugin’s &#64;url nodes. Use &#64;url for opening either URLs or Uniform Node Locators in “*.leo” files and use &#64;mime nodes for opening files on the local file system. It also replaces the startfile.py plugin, where here the headline must start with &#64;mime to activate this plugin.</p>
<p>For other sys.platform’s, add an elif case to the section “guess file association handler” and either define a default _mime_open_cmd string, where “%s” will be replaced with the filename, or define a function taking the filename string as its only argument and set as open_func.</p>
</section>
<section id="multifile-py">
<h4><a class="toc-backref" href="#id63">multifile.py</a><a class="headerlink" href="#multifile-py" title="Permalink to this heading">¶</a></h4>
<p>Allows Leo to write a file to multiple locations.</p>
<p>This plugin acts as a post-write mechanism, a file must be written to the file system for it to work. At this point it is not a replacement for &#64;path or an absolute path, it works in tandem with them.</p>
<p>To use, place &#64;multipath at the start of a line in the root node or an ancestor of the node. The format is (On Unix-like systems):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@multipath</span> <span class="o">/</span><span class="n">machine</span><span class="o">/</span><span class="n">unit</span><span class="o">/</span><span class="p">:</span><span class="o">/</span><span class="n">machine</span><span class="o">/</span><span class="n">robot</span><span class="o">/</span><span class="p">:</span><span class="o">/</span><span class="n">machine</span><span class="o">/</span>
</pre></div>
</div>
<p>New in version 0.6 of this plugin: the separator used above is ‘;’ not ‘:’, for example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@multipath</span> <span class="n">c</span><span class="p">:</span>\<span class="n">prog</span>\<span class="n">test</span><span class="p">;</span><span class="n">c</span><span class="p">:</span>\<span class="n">prog</span>\<span class="n">unittest</span>
</pre></div>
</div>
<p>It will places copy of the written file in each of these directories.</p>
<p>There is an additional directive that simplifies common paths, it is called
&#64;multiprefix. By typing &#64;multiprefix with a path following it, before a
&#64;multipath directive you set the beginning of the paths in the &#64;multipath
directive. For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#@multiprefix /leo #@multipath /plugins</span>
</pre></div>
</div>
<p>or:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#@multiprefix /leo/</span>
<span class="c1">#@multipath plugins: fungus : drain</span>
</pre></div>
</div>
<p>copies a file to /leo/plugins /leo/fungus /leo/drain.</p>
<p><strong>Note</strong>: I put # in front of the directives here because I don’t want someone browsing this file to accidentally save multiple copies of this file to their system!</p>
<p>The &#64;multiprefix stays in effect for the entire tree until reset with another
&#64;multiprefix directive. &#64;multipath is cumulative, in that for each &#64;multipath in
an ancestor a copy of the file is created. These directives must at the beginning of the line and by themselves.</p>
</section>
<section id="nicenosent-py">
<h4><a class="toc-backref" href="#id64">niceNosent.py</a><a class="headerlink" href="#nicenosent-py" title="Permalink to this heading">¶</a></h4>
<p>Ensures that all descendants of &#64;file-nosent nodes end with exactly one newline, replaces all tabs with spaces, and adds a newline before class and functions in the derived file.</p>
</section>
<section id="notebook-py">
<h4><a class="toc-backref" href="#id65">notebook.py</a><a class="headerlink" href="#notebook-py" title="Permalink to this heading">¶</a></h4>
<p>Edit several nodes at once, in a pannable “notebook” view.</p>
</section>
<section id="read-only-nodes-py">
<h4><a class="toc-backref" href="#id66">read_only_nodes.py</a><a class="headerlink" href="#read-only-nodes-py" title="Permalink to this heading">¶</a></h4>
<p>Creates and updates &#64;read-only nodes.</p>
<p>Here’s my first attempt at customizing leo. I wanted to have the ability to import files in “read-only” mode, that is, in a mode where files could only be read by leo (not tangled), and also kept in sync with the content on the drive.</p>
<p>The reason for this is for example that I have external programs that generate resource files. I want these files to be part of a leo outline, but I don’t want leo to tangle or in any way modify them. At the same time, I want them to be up-to-date in the leo outline.</p>
<p>So I coded the directive plugin. It has the following characteristics:</p>
<ul class="simple">
<li><p>It reads the specified file and puts it into the node content.</p></li>
<li><p>If the &#64;read-only directive was in the leo outline already, and the file content on disk has changed from what is stored in the outline, it marks the node as changed and prints a “changed” message to the log window; if, on the other hand, the file content has _not_ changed, the file is simply read and the node is not marked as changed.</p></li>
<li><p>When you write a &#64;read-only directive, the file content is added to the node immediately, i.e. as soon as you press Enter (no need to call a menu entry to import the content).</p></li>
<li><p>If you want to refresh/update the content of the file, just edit the headline and press Enter. The file is reloaded, and if in the meantime it has changed, a “change” message is sent to the log window.</p></li>
<li><p>The body text of a &#64;read-only file cannot be modified in leo.</p></li>
</ul>
<p>The syntax to access files in &#64;read-only via ftp/http is the following:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@read</span><span class="o">-</span><span class="n">only</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">www</span><span class="o">.</span><span class="n">ietf</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">rfc</span><span class="o">/</span><span class="n">rfc0791</span><span class="o">.</span><span class="n">txt</span>
<span class="nd">@read</span><span class="o">-</span><span class="n">only</span> <span class="n">ftp</span><span class="p">:</span><span class="o">//</span><span class="n">ftp</span><span class="o">.</span><span class="n">someserver</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">filepath</span>
</pre></div>
</div>
<p>If FTP authentication (username/password) is required, it can be specified as follows:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@read</span><span class="o">-</span><span class="n">only</span> <span class="n">ftp</span><span class="p">:</span><span class="o">//</span><span class="n">username</span><span class="p">:</span><span class="n">password</span><span class="nd">@ftp</span><span class="o">.</span><span class="n">someserver</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">filepath</span>
</pre></div>
</div>
<p>For more details, see the doc string for the class FTPurl.</p>
<p>Davide Salomoni</p>
</section>
<section id="run-nodes-py">
<h4><a class="toc-backref" href="#id67">run_nodes.py</a><a class="headerlink" href="#run-nodes-py" title="Permalink to this heading">¶</a></h4>
<p>Runs a program and interface Leos through its input/output/error streams.</p>
<p>Double clicking the icon box whose headlines are &#64;run ‘cmd args’ will execute the command. There are several other features, including &#64;arg and &#64;input nodes.</p>
<p>The run_nodes.py plugin introduce two new nodes that transform leo into a terminal. It was mostly intended to run compilers and debuggers while having the possibility to send messages to the program.</p>
<p>Double clicking on the icon of an node whose headline is &#64;run &lt;command&gt; &lt;args&gt; will launch &lt;command&gt; with the given arguments. It will also mark the node. # Terminates the argument list. &#64;run # &lt;comment&gt; is also valid.</p>
<p>&#64;in nodes are used to send input to the running process. Double clicking on
the icon of an &#64;in &lt;message&gt; node will append a “n” to &lt;message&gt; and write it to the program, no matter where the node is placed. If no &#64;run node is active, nothing happens.</p>
<p>The body text of every child, in which the headlines do not begin with <a class="reference external" href="mailto:'&#37;&#52;&#48;run">‘<span>&#64;</span>run</a>’ or <a class="reference external" href="mailto:'&#37;&#52;&#48;in">‘<span>&#64;</span>in</a>’, will be appended to &lt;command&gt;, allowing you to add an unlimited number of arguments to &lt;command&gt;.</p>
<p>The output of the program is written in the log pane (Error output in red). When the program exit the node is set unmarked and the return value is displayed… When the enter key is pressed in the body pane of an active &#64;run node the content of it body pane is written to the program and then emptied ready for another line of input. If the node have &#64;run nodes in its descendants, they will be launched successively. (Unless one returned an exit code other than 0, then it will stop there)</p>
<p>By Alexis Gendron Paquette. Please send comments to the Leo forums.</p>
</section>
<section id="startfile-py">
<h4><a class="toc-backref" href="#id68">startfile.py</a><a class="headerlink" href="#startfile-py" title="Permalink to this heading">¶</a></h4>
<p>Launches (starts) a file given by a headline when double-clicking the icon.</p>
<p>This plugin ignores headlines starting with an ‘&#64;’. Uses the &#64;folder path if the headline is under an &#64;folder headline. Otherwise the path is relative to the Leo file.</p>
</section>
<section id="timestamp-py">
<h4><a class="toc-backref" href="#id69">timestamp.py</a><a class="headerlink" href="#timestamp-py" title="Permalink to this heading">¶</a></h4>
<p>By Kent Tenney</p>
<p>The timestamp plugin manages the following node attributes:</p>
<ul class="simple">
<li><p>str_ctime: creation time</p></li>
<li><p>str_mtime: time node was last modified</p></li>
<li><p>str_atime: time node contents were last viewed</p></li>
</ul>
</section>
<section id="xsltwithnodes-py">
<h4><a class="toc-backref" href="#id70">xsltWithNodes.py</a><a class="headerlink" href="#xsltwithnodes-py" title="Permalink to this heading">¶</a></h4>
<p>Adds the Outline:XSLT menu containing XSLT-related commands.</p>
<p>This menu contains the following items:</p>
<ul class="simple">
<li><dl class="simple">
<dt>Set StyleSheet Node:</dt><dd><ul>
<li><p>Selects the current node as the xsl stylesheet the plugin will use.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>Process Node with Stylesheet Node:</dt><dd><ul>
<li><p>Processes the current node as an xml document,
resolving section references and Leo directives.</p></li>
<li><p>Creates a sibling containing the results.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
<p>Requires 4Suite 1.0a3 or better, downloadable from <a class="reference external" href="http://4Suite.org">http://4Suite.org</a>.</p>
</section>
</section>
<section id="scripting">
<h3><a class="toc-backref" href="#id71">Scripting</a><a class="headerlink" href="#scripting" title="Permalink to this heading">¶</a></h3>
<section id="dyna-menu">
<h4><a class="toc-backref" href="#id72">dyna_menu</a><a class="headerlink" href="#dyna-menu" title="Permalink to this heading">¶</a></h4>
<p>The dyna_menu plugin is a remarkable body of work by ‘e’. This plugin creates a dyna_menu menu from which you can execute commands. You may download the latest version at: <a class="reference external" href="http://rclick.netfirms.com/dyna_menu.py.html">http://rclick.netfirms.com/dyna_menu.py.html</a></p>
</section>
<section id="leoscreen-py">
<h4><a class="toc-backref" href="#id73">leoscreen.py</a><a class="headerlink" href="#leoscreen-py" title="Permalink to this heading">¶</a></h4>
<p>Allows interaction with shell apps via screen.</p>
<p>Analysis environments like SQL, R, scipy, ipython, etc. can be used by pasting sections of text from an editor (Leo) and a shell window.  Results can be pasted back into the editor.</p>
<p>This plugin streamlines the process by communicating with <code class="docutils literal notranslate"><span class="pre">screen</span></code>, the shell multiplexer</p>
<p><strong>Commands</strong></p>
<dl>
<dt>leoscreen-run-text</dt><dd><p>Send the text selected in Leo’s body text to the shell app.
Selects the next line for your convenience.</p>
</dd>
<dt>leoscreen-get-line</dt><dd><p>Insert a line of the last result from the shell into Leo’s body text
at the current insert point.  Lines are pulled one at a time starting
from the end of the output.  Can be used repeatedly to get the
output you want into Leo.</p>
</dd>
<dt>leoscreen-get-all</dt><dd><p>Insert all of the last result from the shell into Leo’s body text
at the current insert point.</p>
</dd>
<dt>leoscreen-get-note</dt><dd><p>Insert all of the last result from the shell into a new child node of
the current node.</p>
</dd>
<dt>leoscreen-show-all</dt><dd><p>Show the output from the last result from the shell in a temporary
read only window. <strong>Important</strong>: The output is not stored.</p>
</dd>
<dt>leoscreen-show-note</dt><dd><p>Insert all of the last result from the shell into a new child node of
the current node and display that node a a stickynote (requires stickynote
plugin).</p>
</dd>
<dt>leoscreen-next</dt><dd><p>Switch screen session to next window.</p>
</dd>
<dt>leoscreen-prev</dt><dd><p>Switch screen session to preceding window.</p>
</dd>
<dt>leoscreen-other</dt><dd><p>Switch screen session to last window displayed.</p>
</dd>
<dt>leoscreen-get-prefix</dt><dd><p>Interactively get prefix for inserting text into body (#, –, //, etc/)
Can also set using:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">c</span><span class="o">.</span><span class="n">leo_screen</span><span class="o">.</span><span class="n">get_line_prefix</span> <span class="o">=</span> <span class="s1">&#39;#&#39;</span>
</pre></div>
</div>
</dd>
<dt>leoscreen-more-prompt</dt><dd><p>Skip one less line at the end of output when fetching output into Leo.
Adjusts lines skipped to avoid pulling in the applications prompt line.</p>
</dd>
<dt>leoscreen-less-prompt</dt><dd><p>Skip one more line at the end of output when fetching output into Leo
Adjusts lines skipped to avoid pulling in the applications prompt line.</p>
</dd>
</dl>
<p><strong>Settings</strong></p>
<dl class="simple">
<dt>leoscreen_prefix</dt><dd><p>Prepended to output pulled in to Leo. The substring SPACE in this
setting will be replaced with a space character, to allow for trailing
spaces.</p>
</dd>
<dt>leoscreen_time_fmt</dt><dd><p>time.strftime format for note type output headings.</p>
</dd>
</dl>
<p><strong>Theory of operation</strong></p>
<p>leoscreen creates a instance at c.leo_screen which has some methods which might
be useful in <code class="docutils literal notranslate"><span class="pre">&#64;button</span></code> and other Leo contexts.</p>
<p><strong>Example SQL setup</strong></p>
<p>In a Leo file full of interactive SQL analysis, I have:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@settings</span>
    <span class="nd">@string</span> <span class="n">leoscreen_prefix</span> <span class="o">=</span> <span class="o">--</span><span class="n">SPACE</span>
<span class="nd">@button</span> <span class="n">rollback</span>
    <span class="kn">import</span> <span class="nn">time</span>
    <span class="n">c</span><span class="o">.</span><span class="n">leo_screen</span><span class="o">.</span><span class="n">run_text</span><span class="p">(</span><span class="s1">&#39;ROLLBACK;  -- </span><span class="si">%s</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">time</span><span class="o">.</span><span class="n">asctime</span><span class="p">())</span>
<span class="nd">@button</span> <span class="n">commit</span>
    <span class="kn">import</span> <span class="nn">time</span>
    <span class="n">cmd</span> <span class="o">=</span> <span class="s1">&#39;COMMIT;  -- </span><span class="si">%s</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">time</span><span class="o">.</span><span class="n">asctime</span><span class="p">()</span>
    <span class="n">c</span><span class="o">.</span><span class="n">leo_screen</span><span class="o">.</span><span class="n">run_text</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
    <span class="n">c</span><span class="o">.</span><span class="n">leo_screen</span><span class="o">.</span><span class="n">insert_line</span><span class="p">(</span><span class="n">cmd</span><span class="p">)</span>
</pre></div>
</div>
<p>which creates a button to rollback messed up queries, another to commit (requiring additional action to supply the newline as a safeguard) and sets the prefix to “– ” for text pulled back from the SQL session into Leo.</p>
<p><strong>Implementation note</strong>: screen behaves differently if screen -X is executed with the same stdout as the target screen, vs. a different stdout. Although stdout is ignored, Popen() needs to ensure it’s not just inherited.</p>
</section>
<section id="mod-scripting-py">
<h4><a class="toc-backref" href="#id74">mod_scripting.py</a><a class="headerlink" href="#mod-scripting-py" title="Permalink to this heading">¶</a></h4>
<p>Creates script buttons and &#64;button, &#64;command, &#64;plugin and &#64;script nodes.</p>
<p>This plugin puts buttons in the icon area. Depending on settings the plugin will create the ‘Run Script’, the ‘Script Button’ and the ‘Debug Script’ buttons.</p>
<p>The ‘Run Script’ button is simply another way of doing the Execute Script command: it executes the selected text of the presently selected node, or the entire text if no text is selected.</p>
<p>The ‘Script Button’ button creates <em>another</em> button in the icon area every time you push it. The name of the button is the headline of the presently selected node. Hitting this <em>newly created</em> button executes the button’s script.</p>
<p>For example, to run a script on any part of an outline do the following:</p>
<ol class="arabic simple">
<li><p>Select the node containing the script.</p></li>
<li><p>Press the scriptButton button.  This will create a new button.</p></li>
<li><p>Select the node on which you want to run the script.</p></li>
<li><p>Push the <em>new</em> button.</p></li>
</ol>
<p>That’s all.</p>
<p>For every &#64;button node, this plugin creates two new minibuffer commands: x and delete-x-button, where x is the ‘cleaned’ name of the button. The ‘x’ command is equivalent to pushing the script button.</p>
<p>You can specify <strong>global buttons</strong> in leoSettings.leo or myLeoSettings.leo by putting &#64;button nodes as children of an &#64;buttons node in an &#64;settings trees. Such buttons are included in all open .leo (in a slightly different color). Actually, you can specify global buttons in any .leo file, but &#64;buttons nodes affect all later opened .leo files so usually you would define global buttons in leoSettings.leo or myLeoSettings.leo.</p>
<p>The cleaned name of an &#64;button node is the headline text of the button with:</p>
<ul class="simple">
<li><p>Leading &#64;button or &#64;command removed,</p></li>
<li><p>&#64;key and all following text removed,</p></li>
<li><p>&#64;args and all following text removed,</p></li>
<li><p>all non-alphanumeric characters converted to a single ‘-’ characters.</p></li>
</ul>
<p>Thus, cleaning headline text converts it to a valid minibuffer command name.</p>
<p>You can delete a script button by right-clicking on it, or by executing the delete-x-button command.</p>
<p>The ‘Debug Script’ button runs a script using an external debugger.</p>
<p>This plugin optionally scans for &#64;button nodes, &#64;command, &#64;plugin nodes and
&#64;script nodes whenever a .leo file is opened.</p>
<ul class="simple">
<li><p>&#64;button nodes create script buttons.</p></li>
<li><p>&#64;command nodes create minibuffer commands.</p></li>
<li><p>&#64;plugin nodes cause plugins to be loaded.</p></li>
<li><p>&#64;script nodes cause a script to be executed when opening a .leo file.</p></li>
</ul>
<p>Such nodes may be security risks. This plugin scans for such nodes only if the corresponding atButtonNodes, atPluginNodes, and atScriptNodes constants are set to True in this plugin.</p>
<p>You can specify the following options in leoSettings.leo.  See the node:
&#64;settings–&gt;Plugins–&gt;scripting plugin.  Recommended defaults are shown:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>@bool scripting-at-button-nodes = True
True: adds a button for every @button node.

@bool scripting-at-commands-nodes = True
True: define a minibuffer command for every @command node.

@bool scripting-at-plugin-nodes = False
True: dynamically loads plugins in @plugins nodes when a window is created.

@bool scripting-at-script-nodes = False
True: dynamically executes script in @script nodes when a window is created.
This is dangerous!

@bool scripting-create-debug-button = False
True: create Debug Script button.

@bool scripting-create-run-script-button = False
True: create Run Script button.
Note: The plugin creates the press-run-script-button regardless of this setting.

@bool scripting-create-script-button-button = True
True: create Script Button button in icon area.
Note: The plugin creates the press-script-button-button
      regardless of this setting.

@int scripting-max-button-size = 18
The maximum length of button names: longer names are truncated.
</pre></div>
</div>
<p>You can bind key shortcuts to &#64;button and &#64;command nodes as follows.</p>
<p>&#64;button name &#64;key=shortcut</p>
<blockquote>
<div><p>Binds the shortcut to the script in the script button. The button’s name is
‘name’, but you can see the full headline in the status line when you move the
mouse over the button.</p>
</div></blockquote>
<p>&#64;command name &#64;key=shortcut</p>
<blockquote>
<div><p>Creates a new minibuffer command and binds shortcut to it. As with &#64;buffer
nodes, the name of the command is the cleaned name of the headline.</p>
</div></blockquote>
<p>This plugin is based on ideas from e’s dynabutton plugin, quite possibly the most brilliant idea in Leo’s history.</p>
<p>You can run the script with sys.argv initialized to string values using &#64;args. For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@button</span> <span class="n">test</span><span class="o">-</span><span class="n">args</span> <span class="nd">@args</span> <span class="o">=</span> <span class="n">a</span><span class="p">,</span><span class="n">b</span><span class="p">,</span><span class="n">c</span>
</pre></div>
</div>
<p>will set sys.argv to [u’a’,u’b’,u’c’]</p>
</section>
<section id="script-io-to-body-py">
<h4><a class="toc-backref" href="#id75">script_io_to_body.py</a><a class="headerlink" href="#script-io-to-body-py" title="Permalink to this heading">¶</a></h4>
<p>Sends output from the Execute Script command to the end of the body pane.</p>
</section>
</section>
<section id="servers">
<h3><a class="toc-backref" href="#id76">Servers</a><a class="headerlink" href="#servers" title="Permalink to this heading">¶</a></h3>
<section id="leo-cloud-py">
<h4><a class="toc-backref" href="#id77">leo_cloud.py</a><a class="headerlink" href="#leo-cloud-py" title="Permalink to this heading">¶</a></h4>
<p>Synchronize &#64;leo_cloud subtrees with remote central server.</p>
</section>
<section id="leoremote-py">
<h4><a class="toc-backref" href="#id78">leoremote.py</a><a class="headerlink" href="#leoremote-py" title="Permalink to this heading">¶</a></h4>
<p>Remote control for Leo.</p>
<p>Example client:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">leo.external</span> <span class="kn">import</span> <span class="n">lproto</span>
<span class="kn">import</span> <span class="nn">os</span>


<span class="n">addr</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">expanduser</span><span class="p">(</span><span class="s1">&#39;~/.leo/leoserv_sockname&#39;</span><span class="p">))</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;will connect to&quot;</span><span class="p">,</span><span class="n">addr</span><span class="p">)</span>
<span class="n">pc</span>  <span class="o">=</span> <span class="n">lproto</span><span class="o">.</span><span class="n">LProtoClient</span><span class="p">(</span><span class="n">addr</span><span class="p">)</span>
<span class="n">pc</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s2">&quot;&quot;&quot;</span>
<span class="s2">    g.es(&quot;hello world from remote&quot;)</span>
<span class="s2">    c = g.app.commanders()[0]</span>
<span class="s2">&quot;&quot;&quot;</span><span class="p">)</span>

<span class="c1"># note how c persists between calls</span>
<span class="n">pc</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s2">&quot;&quot;&quot;c.k.simulateCommand(&#39;stickynote&#39;)&quot;&quot;&quot;</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="mod-http-py">
<h4><a class="toc-backref" href="#id79">mod_http.py</a><a class="headerlink" href="#mod-http-py" title="Permalink to this heading">¶</a></h4>
<p>A minimal http plugin for Leo, based on AsyncHttpServer.py.</p>
<p>Use this plugin is as follows:</p>
<ol class="arabic">
<li><p>Start Leo with the plugin enabled. You will see a purple message that says something like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">http</span> <span class="n">serving</span> <span class="n">enabled</span> <span class="n">on</span> <span class="n">port</span> <span class="mf">8130.</span><span class="o">..</span>
</pre></div>
</div>
</li>
<li><p>Start a web browser, and enter the following url: <a class="reference external" href="http://localhost:8130/">http://localhost:8130/</a></p></li>
</ol>
<p>You will see a a “top” level page containing one link for every open .leo file. Start clicking :-)</p>
<p>You can use the browser’s refresh button to update the top-level view in the browser after you have opened or closed files.</p>
<p>To enable this plugin put this into your file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@settings</span>
<span class="nd">@bool</span> <span class="n">http_active</span> <span class="o">=</span> <span class="kc">True</span>
<span class="nd">@int</span>  <span class="n">port</span> <span class="o">=</span> <span class="mi">8130</span>
<span class="nd">@string</span> <span class="n">rst_http_attributename</span> <span class="o">=</span> <span class="s1">&#39;rst_http_attribute&#39;</span>
</pre></div>
</div>
<p><strong>Note</strong>: the browser_encoding constant (defined in the top node of this file) must match the character encoding used in the browser. If it does not, non-ascii characters will look strange.</p>
</section>
</section>
<section id="slideshows-and-screenshots">
<h3><a class="toc-backref" href="#id80">Slideshows and screenshots</a><a class="headerlink" href="#slideshows-and-screenshots" title="Permalink to this heading">¶</a></h3>
<section id="demo-py">
<h4><a class="toc-backref" href="#id81">demo.py</a><a class="headerlink" href="#demo-py" title="Permalink to this heading">¶</a></h4>
<p>A plugin that makes making Leo demos easy. See <a class="reference external" href="https://github.com/leo-editor/leo-editor/blob/master/leo/doc/demo.md">this page</a> for complete documentation. <strong>Important</strong>: This plugin largely replaces screenshots.py and slideshow.py.</p>
</section>
<section id="screenshots-py">
<h4><a class="toc-backref" href="#id82">screenshots.py</a><a class="headerlink" href="#screenshots-py" title="Permalink to this heading">¶</a></h4>
<p>Creates stand-alone slideshows containing screenshots.</p>
<p>This plugin defines five commands. The <strong>apropos-slides</strong> command prints this message to Leo’s log pane. The <strong>slide-show-info</strong> command prints the settings in effect.</p>
<p>The <strong>make-slide</strong> and <strong>make-slide-show</strong> commands, collectively called <strong>slide commands</strong>, create collections of slides from <strong>&#64;slideshow</strong> trees containing <strong>&#64;slide</strong> nodes.</p>
<p>Slides may link to screenshots. The slide commands can generate screenshots from <strong>&#64;screenshot-tree</strong> nodes, but this feature has proven to be clumsy and inflexible. It is usually more convenient to use screenshots taken with a program such as Wink. The <strong>meld-slides</strong> command creates references to externally-generated screenshots within &#64;slide nodes.</p>
<p>&#64;slide nodes may contain <strong>&#64;url nodes</strong>. These &#64;url nodes serve two purposes. First, they allow you to see various files (slides, initial screenshots, working files and final screenshots). Second, these &#64;url nodes guide the meld script and the four commands defined by this plugin (see below). By inserting or deleting these &#64;url nodes you (or your scripts) can customize how the commands (and meld) work. In effect, the &#64;url nodes become per-slide settings.</p>
<p><strong>Prerequisites</strong></p>
<dl class="simple">
<dt>Inkscape (Required)</dt><dd><p>An SVG editor: <a class="reference external" href="http://www.inkscape.org/">http://www.inkscape.org/</a>
Allows the user to edit screenshots.
Required to create final output (PNG) files.</p>
</dd>
<dt>PIL (Optional but highly recommended)</dt><dd><p>The Python Imaging Library,
<a class="reference external" href="http://www.pythonware.com/products/pil/">http://www.pythonware.com/products/pil/</a></p>
</dd>
<dt>Wink (Optional)</dt><dd><p>A program that creates slideshows and slides.
<a class="reference external" href="http://www.debugmode.com/wink/">http://www.debugmode.com/wink/</a></p>
</dd>
</dl>
<p><strong>Summary</strong></p>
<dl class="simple">
<dt>&#64;slideshow &lt;slideshow-name&gt;</dt><dd><p>Creates the folder:
&lt;sphinx_path&gt;/slides/&lt;slideshow-name&gt;</p>
</dd>
<dt>&#64;slide &lt;ignored text&gt;</dt><dd><p>Creates slide-&lt;slide-number&gt;.html
(in the sphinx _build directory).
<strong>Note</strong>: the plugin skips any &#64;slide nodes
with empty body text.</p>
</dd>
<dt>&#64;screenshot</dt><dd><p>Specifies the contents of the screenshot.</p>
</dd>
</dl>
<p><strong>Options</strong> are child nodes of &#64;slideshow or &#64;slide nodes that control the make-slide and make-slide-show commands. See the Options section below.</p>
<p>The make-slide and make-slide-show commands create the following &#64;url nodes as children of each &#64;slide node:</p>
<dl class="simple">
<dt>&#64;url built slide</dt><dd><p>Contains the absolute path to the final slide in
the _build/html subfolder of the slideshow
folder. If present, this &#64;url node completely
disables rebuilding the slide.</p>
</dd>
<dt>&#64;url screenshot</dt><dd><p>Contains the absolute path to the original
screenshot file. If present, this &#64;url node
inhibits taking the screenshot.</p>
</dd>
<dt>&#64;url working file</dt><dd><p>Contains the absolute path to the working file.
If present, this &#64;url node disables taking the
screenshot, creating the working file. The final
output file will be regenerated if the working
file is newer than the final output file.</p>
</dd>
<dt>&#64;url final output file</dt><dd><p>Contains the absolute path to the final output
file.</p>
</dd>
</dl>
<p>Thus, to completely recreate an &#64;slide node, you must delete any of the following nodes that appear as its children:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@url</span> <span class="n">screenshot</span>
<span class="nd">@url</span> <span class="n">working</span> <span class="n">file</span>
<span class="nd">@url</span> <span class="n">built</span> <span class="n">slide</span>
</pre></div>
</div>
<p><strong>Making slides</strong></p>
<p>For each slide, the make-slide and make-slide-show commands do the following:</p>
<ol class="arabic simple">
<li><p>Create a slide.</p></li>
</ol>
<blockquote>
<div><p>If the &#64;slide node contains an &#64;screenshot tree,
the plugin appends an <code class="docutils literal notranslate"><span class="pre">..</span> <span class="pre">image::</span></code> directive
referring to the screenshot to the body text of
the &#64;slide node. The plugin also creates a child
&#64;image node referring to the screenshot.</p>
</div></blockquote>
<ol class="arabic simple" start="2">
<li><p>(Optional) Create a screenshot.</p></li>
</ol>
<blockquote>
<div><p>The plugin creates a screenshot for an &#64;slide
node only if the &#64;slide node contains an
&#64;screenshot node as a direct child.</p>
<p><strong>Important</strong>: this step has largely been
superseded by the <code class="docutils literal notranslate"><span class="pre">&#64;button</span> <span class="pre">meld</span></code> script in
LeoDocs.leo.</p>
<p>Taking a screenshot involves the following steps:</p>
<ol class="upperalpha simple">
<li><p>Create the <strong>target outline</strong>: screenshot-setup.leo.</p></li>
</ol>
<blockquote>
<div><p>The target outline contains consists of all
the children (and their descendants) of the
&#64;screenshot node.</p>
</div></blockquote>
<ol class="upperalpha simple" start="2">
<li><p>Create the <strong>screenshot</strong>, a bitmap (PNG) file.</p></li>
</ol>
<blockquote>
<div><p>The slide commands take a screen shot of the
target outline. The &#64;pause option opens the
target outline but does <em>not</em> take the
screenshot. The user must take the screenshot
manually. For more details, see the the
options section below.</p>
</div></blockquote>
<ol class="upperalpha simple" start="3">
<li><p>Convert the screenshot file to a <strong>work file</strong>.</p></li>
</ol>
<blockquote>
<div><p>The work file is an SVG (Scalable Vector
Graphics) file: <a class="reference external" href="http://www.w3.org/Graphics/SVG/">http://www.w3.org/Graphics/SVG/</a>.</p>
</div></blockquote>
<ol class="upperalpha simple" start="4">
<li><p>(Optional) Edit the work file.</p></li>
</ol>
<blockquote>
<div><p>If the &#64;slide node has a child &#64;edit node, the
plugin opens Inkscape so that the user can
edit the work file.</p>
</div></blockquote>
<ol class="upperalpha simple" start="5">
<li><p>Render the <strong>final output file</strong>.</p></li>
</ol>
<blockquote>
<div><p>The plugin calls Inkscape non-interactively to
render the final output file (a PNG image)
from the work file. If the Python Imaging
Library (PIL) is available, this step will use
PIL to improve the quality of the final output
file.</p>
</div></blockquote>
</div></blockquote>
<ol class="arabic simple" start="3">
<li><p>Build the slide using Sphinx.</p></li>
</ol>
<blockquote>
<div><p>After making all files, the plugins runs Sphinx
by running ‘make html’ in the slideshow folder.
This command creates the final .html files in the
_build/html subfolder of the slideshow folder.</p>
</div></blockquote>
<ol class="arabic simple" start="4">
<li><p>Create url nodes.</p></li>
</ol>
<blockquote>
<div><p>Depending on options, and already-existing &#64;url
nodes, the make-slide and make-slide-show
commands may create one or more of the following
&#64;url nodes:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@url</span> <span class="n">built</span> <span class="n">slide</span>
<span class="nd">@url</span> <span class="n">screenshot</span>
<span class="nd">@url</span> <span class="n">working</span> <span class="n">file</span>
<span class="nd">@url</span> <span class="n">final</span> <span class="n">output</span> <span class="n">file</span>
</pre></div>
</div>
</div></blockquote>
<p><strong>Options and settings</strong></p>
<p>You specify options in the headlines of nodes. <strong>Global options</strong> appear as direct children of &#64;slideshow nodes and apply to all &#64;slide nodes unless overridden by a local option. <strong>Local options</strong> appear as direct children of an &#64;slide node and apply to only to that &#64;slide node.</p>
<p><strong>Global options nodes</strong></p>
<p>The following nodes may appear <em>either</em> as a direct child of the &#64;slideshow node or as the direct child of an &#64;slide node.</p>
<dl>
<dt>&#64;sphinx_path = &lt;path&gt;</dt><dd><p>This directory contains the slides directory,
and the following files: ‘conf.py’, ‘Makefile’ and ‘make.bat’.</p>
</dd>
<dt>&#64;screenshot_height = &lt;int&gt;</dt><dd><p>The height in pixels of screenshots.</p>
</dd>
<dt>&#64;screenshot_width = &lt;int&gt;</dt><dd><p>The height in pixels of screenshots.</p>
</dd>
<dt>&#64;template_fn = &lt;path&gt;</dt><dd><p>The absolute path to inkscape-template.svg</p>
</dd>
<dt>&#64;title = &lt;any text&gt;</dt><dd><p>The title to use for one slide or the entire
slideshow.</p>
</dd>
<dt>&#64;title_pattern = &lt;pattern&gt;</dt><dd><p>The pattern used to generate patterns for one
slide or the entire slideshow. The title is
computed as follows:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">d</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;slideshow_name&#39;</span><span class="p">:</span><span class="n">slideshow_name</span><span class="p">,</span>
    <span class="s1">&#39;slide_name&#39;</span><span class="p">:</span>    <span class="n">slide_name</span><span class="p">,</span>
    <span class="s1">&#39;slide_number&#39;</span><span class="p">:</span>  <span class="n">sc</span><span class="o">.</span><span class="n">slide_number</span><span class="p">,</span>
<span class="p">}</span>
<span class="n">title</span> <span class="o">=</span> <span class="p">(</span><span class="n">pattern</span> <span class="o">%</span> <span class="p">(</span><span class="n">d</span><span class="p">))</span><span class="o">.</span><span class="n">title</span><span class="p">()</span>
</pre></div>
</div>
<p>If neither an &#64;title or &#64;title_pattern option
node applies, the title is the headline of the
&#64;slide node. If this is empty, the default
pattern is:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s1">&#39;</span><span class="si">%(slideshow_name)s</span><span class="s1">:</span><span class="si">%(slide_number)s</span><span class="s1">&#39;</span>
</pre></div>
</div>
</dd>
<dt>&#64;verbose = True/False</dt><dd><p>True (or true or 1):  generate informational message.
False (or false or 0): suppress informational messages.</p>
</dd>
<dt>&#64;wink_path = &lt;path&gt;</dt><dd><p>This path contains screenshots created by wink.
This is used only by the meld-slides command.</p>
</dd>
</dl>
<p><strong>Local options nodes</strong></p>
<p>The following nodes are valid only as the direct child of an &#64;slide node.</p>
<dl>
<dt>&#64;callout &lt;any text&gt;</dt><dd><p>Generates a text callout in the working .svg file.
An &#64;slide node may have several &#64;callout children.</p>
</dd>
<dt>&#64;edit = True/False</dt><dd><p>If True (or true or 1) the plugin enters
Inkscape interactively after taking a
screenshot.</p>
</dd>
<dt>&#64;markers = &lt;list of integers&gt;</dt><dd><p>Generates ‘numbered balls’ in the working .svg file.</p>
</dd>
<dt>&#64;pause = True/False</dt><dd><p>If True (or true or 1) the user must take the
screenshot manually. Otherwise, the plugin takes
the screenshot automatically.</p>
<p>If the slide node contains an &#64;pause node as one
of its directive children, the slide commands
open the target node, but do <em>not</em> take a screen
shot.</p>
<p>The user may adjust the screen as desired, for
example by selecting menus or showing dialogs.
The <em>user</em> must then take the screen shot
manually. <strong>Important</strong>: the screenshot need not
be of Leo–it could be a screenshot of anything
on the screen.</p>
<p>As soon as the user closes the target
outline, the slide commands look for the screen
shot on the clipboard. If found, the slide
commands save the screenshot to the screenshot
file.</p>
</dd>
<dt>&#64;screenshot</dt><dd><p>The root of a tree that becomes the entire
contents of screenshot. No screenshot is taken
if this node does not exist.</p>
</dd>
<dt>&#64;select &lt;headline&gt;</dt><dd><p>Causes the given headline in the &#64;screenshot
outline to be selected before taking the screenshot.</p>
</dd>
</dl>
<p><strong>Settings</strong></p>
<dl class="simple">
<dt>&#64;string screenshot-bin = &lt;path to inkscape.exe&gt;</dt><dd><p>The full path to the Inkscape program.</p>
</dd>
</dl>
<p><strong>File names</strong></p>
<p>Suppose the &#64;slide node is the n’th &#64;slide node in the &#64;slideshow tree whose sanitized name is ‘name’. The following files will be created in (relative to) the slideshow directory:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">slide</span><span class="o">-</span><span class="n">n</span><span class="o">.</span><span class="n">html</span><span class="o">.</span><span class="n">txt</span><span class="p">:</span>   <span class="n">the</span> <span class="n">slide</span><span class="s1">&#39;s rST source.</span>
<span class="n">screenshot</span><span class="o">-</span><span class="n">n</span><span class="o">.</span><span class="n">png</span><span class="p">:</span>   <span class="n">the</span> <span class="n">original</span> <span class="n">screenshot</span><span class="o">.</span>
<span class="n">screenshot</span><span class="o">-</span><span class="n">n</span><span class="o">.</span><span class="n">svg</span><span class="p">:</span>   <span class="n">the</span> <span class="n">working</span> <span class="n">file</span><span class="o">.</span>
<span class="n">slide</span><span class="o">-</span><span class="n">n</span><span class="o">.</span><span class="n">png</span><span class="p">:</span>        <span class="n">the</span> <span class="n">final</span> <span class="n">output</span> <span class="n">file</span><span class="o">.</span>
<span class="n">_build</span><span class="o">/</span><span class="n">html</span><span class="o">/</span><span class="n">slide</span><span class="o">-</span><span class="n">n</span><span class="o">.</span><span class="n">html</span><span class="p">:</span> <span class="n">the</span> <span class="n">final</span> <span class="n">slide</span><span class="o">.</span>
</pre></div>
</div>
</section>
<section id="slideshow-py">
<h4><a class="toc-backref" href="#id83">slideshow.py</a><a class="headerlink" href="#slideshow-py" title="Permalink to this heading">¶</a></h4>
<p>Support slideshows in Leo outlines.</p>
<p>This plugin defines four new commands:</p>
<ul class="simple">
<li><p>next-slide-show:  move to the start of the next slide show,
or the first slide show if no slide show has been seen yet.</p></li>
<li><p>prev-slide-show:  move to the start of the previous slide show,
or the first slide show if no slide show has been seen yet.</p></li>
<li><p>next-slide: move to the next slide of a present slide show.</p></li>
<li><p>prev-slide: move to the previous slide of the present slide show.</p></li>
</ul>
<p>Slides shows consist of a root &#64;slideshow node with descendant &#64;slide nodes. &#64;slide nodes may be organized via <a class="reference external" href="mailto:non-&#37;&#52;&#48;slide">non-<span>&#64;</span>slide</a> nodes that do not appear in the slideshow.</p>
<p>All these commands ignore &#64;ignore trees.</p>
</section>
</section>
<section id="text-formatting">
<h3><a class="toc-backref" href="#id84">Text formatting</a><a class="headerlink" href="#text-formatting" title="Permalink to this heading">¶</a></h3>
<section id="bibtex-py">
<h4><a class="toc-backref" href="#id85">bibtex.py</a><a class="headerlink" href="#bibtex-py" title="Permalink to this heading">¶</a></h4>
<p>Manages BibTeX files with Leo.</p>
<p>Create a bibliographic database by putting <a class="reference external" href="mailto:'&#37;&#52;&#48;bibtex">‘<span>&#64;</span>bibtex</a> filename’ in a headline. Entries are added as nodes, with <a class="reference external" href="mailto:'&#37;&#52;&#48;entrytype">‘<span>&#64;</span>entrytype</a> key’ as the headline, and the contents of the entry in body text. The plugin will automatically insert a template for the entry in the body pane when a new entry is created (hooked to pressing enter when typing the headline text). The templates are defined in dictionary ‘templates’ in the &lt;&lt;globals&gt;&gt; section, by default containing all required fields for every entry.</p>
<p>The file is written by double-clicking the node. Thus the following outline:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span><span class="nd">@bibtex</span> <span class="n">biblio</span><span class="o">.</span><span class="n">bib</span>
 <span class="o">+</span><span class="nd">@book</span> <span class="n">key</span>
  <span class="n">author</span> <span class="o">=</span> <span class="p">{</span><span class="n">P</span><span class="o">.</span> <span class="n">D</span><span class="o">.</span> <span class="n">James</span><span class="p">},</span>
  <span class="n">year</span> <span class="o">=</span> <span class="mi">1999</span>
</pre></div>
</div>
<p>will be written in the file ‘biblio.bib’ as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@book</span><span class="p">{</span><span class="n">key</span><span class="p">,</span>
<span class="n">author</span> <span class="o">=</span> <span class="p">{</span><span class="n">P</span><span class="o">.</span> <span class="n">D</span><span class="o">.</span> <span class="n">James</span><span class="p">},</span>
<span class="n">year</span><span class="o">=</span> <span class="mi">1999</span><span class="p">}</span>
</pre></div>
</div>
<p>Strings are defined in &#64;string nodes and they can contain multiple entries. All &#64;string nodes are written at the start of the file. Thus the following outline:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span><span class="nd">@bibtext</span> <span class="n">biblio</span><span class="o">.</span><span class="n">bib</span>
 <span class="o">+</span><span class="nd">@string</span>
  <span class="n">j1</span> <span class="o">=</span> <span class="p">{</span><span class="n">Journal1</span><span class="p">}</span>
 <span class="o">+</span><span class="nd">@article</span> <span class="n">AUj1</span>
  <span class="n">author</span> <span class="o">=</span> <span class="p">{</span><span class="n">P</span><span class="o">.</span> <span class="n">D</span><span class="o">.</span> <span class="n">James</span><span class="p">},</span>
  <span class="n">journal</span> <span class="o">=</span> <span class="n">j1</span>
 <span class="o">+</span><span class="nd">@string</span>
  <span class="n">j2</span> <span class="o">=</span> <span class="p">{</span><span class="n">Journal2</span><span class="p">}</span>
  <span class="n">j3</span> <span class="o">=</span> <span class="p">{</span><span class="n">Journal3</span><span class="p">}</span>
</pre></div>
</div>
<p>Will be written as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@string</span><span class="p">{</span><span class="n">j1</span> <span class="o">=</span> <span class="p">{</span><span class="n">Journal1</span><span class="p">}}</span>
<span class="nd">@string</span><span class="p">{</span><span class="n">j2</span> <span class="o">=</span> <span class="p">{</span><span class="n">Journal2</span><span class="p">}}</span>
<span class="nd">@string</span><span class="p">{</span><span class="n">j3</span> <span class="o">=</span> <span class="p">{</span><span class="n">Journal3</span><span class="p">}}</span>

<span class="nd">@article</span><span class="p">{</span><span class="n">AUj1</span><span class="p">,</span>
<span class="n">author</span> <span class="o">=</span> <span class="p">{</span><span class="n">P</span><span class="o">.</span> <span class="n">D</span><span class="o">.</span> <span class="n">James</span><span class="p">},</span>
<span class="n">journal</span> <span class="o">=</span> <span class="n">j1</span><span class="p">}</span>
</pre></div>
</div>
<p>No error checking is made on the syntax. The entries can be organized under nodes — if the headline doesn’t start with ‘&#64;’, the headline and body text are ignored, but the child nodes are parsed as usual.</p>
<p>BibTeX files can be imported by creating an empty node with <a class="reference external" href="mailto:'&#37;&#52;&#48;bibtex">‘<span>&#64;</span>bibtex</a> filename’ in the headline. Double-clicking it will read the file ‘filename’ and parse it into a &#64;bibtex tree. No syntax checking is made, ‘filename’ is expected to be a valid BibTeX file.</p>
</section>
<section id="dtest-py">
<h4><a class="toc-backref" href="#id86">dtest.py</a><a class="headerlink" href="#dtest-py" title="Permalink to this heading">¶</a></h4>
<p>Sends code to the doctest module and reports the result.</p>
<p>When the Dtest plugin is enabled, the <code class="docutils literal notranslate"><span class="pre">dtest</span></code> command is active.
Typing:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Alt</span><span class="o">-</span><span class="n">X</span> <span class="n">dtest</span>
</pre></div>
</div>
<p>will run doctest on a file consisting of the current node and it’s children. If text is selected only the selection is tested.</p>
<p>From Wikipedia:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s1">&#39;Doctest&#39;</span> <span class="ow">is</span> <span class="n">a</span> <span class="n">module</span> <span class="n">included</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">Python</span> <span class="n">programming</span> <span class="n">language</span><span class="s1">&#39;s</span>
<span class="n">standard</span> <span class="n">library</span> <span class="n">that</span> <span class="n">allows</span> <span class="k">for</span> <span class="n">easy</span> <span class="n">generation</span> <span class="n">of</span> <span class="n">tests</span> <span class="n">based</span> <span class="n">on</span>
<span class="n">output</span> <span class="kn">from</span> <span class="nn">the</span> <span class="n">standard</span> <span class="n">Python</span> <span class="n">interpreter</span><span class="o">.</span>
</pre></div>
</div>
<p><a class="reference external" href="http://tinyurl.com/cqh53">http://tinyurl.com/cqh53</a> - Python.org doctest page</p>
<p><a class="reference external" href="http://tinyurl.com/pxhlq">http://tinyurl.com/pxhlq</a> - Jim Fulton’s presentation:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Literate</span> <span class="n">Testing</span><span class="p">:</span>
<span class="n">Automated</span> <span class="n">Testing</span> <span class="k">with</span> <span class="n">doctest</span>
</pre></div>
</div>
</section>
<section id="leo-to-html-py">
<h4><a class="toc-backref" href="#id87">leo_to_html.py</a><a class="headerlink" href="#leo-to-html-py" title="Permalink to this heading">¶</a></h4>
<p>Converts a leo outline to an html web page.</p>
<p>This plugin takes an outline stored in Leo and converts it to html which is then either saved in a file or shown in a browser. It is based on the original leoToHTML 1.0 plugin by Dan Rahmel which had bullet list code by Mike Crowe.</p>
<p>The outline can be represented as a bullet list, a numbered list or using html &lt;h?&gt; type headings. Optionally, the body text may be included in the output.</p>
<p>If desired, only the current node will be included in the output rather than the entire outline.</p>
<p>An xhtml header may be included in the output, in which case the code will be valid XHTML 1.0 Strict.</p>
<p>The plugin is fully scriptable as all its functionality is available through a Leo_to_HTML object which can be imported and used in scripts.</p>
<p><strong>Menu items and &#64;settings</strong></p>
<p>If this plugin loads properly, the following menu items should appear in your File &gt; Export… menu in Leo:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Save</span> <span class="n">Outline</span> <span class="k">as</span> <span class="n">HTML</span>  <span class="p">(</span><span class="n">equivalent</span> <span class="n">to</span> <span class="n">export</span><span class="o">-</span><span class="n">html</span><span class="p">)</span>
<span class="n">Save</span> <span class="n">Node</span> <span class="k">as</span> <span class="n">HTML</span>     <span class="p">(</span><span class="n">equivalent</span> <span class="n">to</span> <span class="n">export</span><span class="o">-</span><span class="n">html</span><span class="o">-</span><span class="n">node</span><span class="p">)</span>
<span class="n">Show</span> <span class="n">Outline</span> <span class="k">as</span> <span class="n">HTML</span>  <span class="p">(</span><span class="n">equivalent</span> <span class="n">to</span> <span class="n">show</span><span class="o">-</span><span class="n">html</span><span class="p">)</span>
<span class="n">Show</span> <span class="n">Node</span> <span class="k">as</span> <span class="n">HTML</span>     <span class="p">(</span><span class="n">equivalent</span> <span class="n">to</span> <span class="n">show</span><span class="o">-</span><span class="n">html</span><span class="o">-</span><span class="n">node</span><span class="p">)</span>
</pre></div>
</div>
<p><em>Unless</em> the following appears in an &#64;setting tree:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@bool</span> <span class="n">leo_to_html_no_menus</span> <span class="o">=</span> <span class="kc">True</span>
</pre></div>
</div>
<p>in which case the menus will <strong>not</strong> be created. This is so that the user can use &#64;menu and &#64;item to decide which commands will appear in the menu and where.</p>
<p><strong>Commands</strong></p>
<p>Several commands will also be made available</p>
<dl class="simple">
<dt>export-html</dt><dd><p>will export to a file according to current settings.</p>
</dd>
<dt>export-html-*</dt><dd><p>will export to a file using bullet type ‘*’ which can be
<strong>number</strong>, <strong>bullet</strong> or <strong>head</strong>.</p>
</dd>
</dl>
<p>The following commands will start a browser showing the html.</p>
<dl class="simple">
<dt>show-html</dt><dd><p>will show the outline according to current settings.</p>
</dd>
<dt>show-html-*</dt><dd><p>will show the outline using bullet type ‘*’ which can be
<strong>number</strong>, <strong>bullet</strong> or <strong>head</strong>.</p>
</dd>
</dl>
<p>The following commands are the same as above except only the current node is converted:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">export</span><span class="o">-</span><span class="n">html</span><span class="o">-</span><span class="n">node</span>
<span class="n">export</span><span class="o">-</span><span class="n">html</span><span class="o">-</span><span class="n">node</span><span class="o">-*</span>
<span class="n">show</span><span class="o">-</span><span class="n">html</span><span class="o">-</span><span class="n">node</span>
<span class="n">show</span><span class="o">-</span><span class="n">html</span><span class="o">-</span><span class="n">node</span><span class="o">-*</span>
</pre></div>
</div>
<p><strong>Properties</strong></p>
<p>There are several settings that can appear in the leo_to_html.ini properties file in leo’s plugins folder or be set via the Plugins &gt; leo_to_html &gt; Properties… menu. These are:</p>
<dl>
<dt>exportpath:</dt><dd><p>The path to the folder where you want to store the generated html file.
Default: c:\</p>
</dd>
<dt>flagjustheadlines:</dt><dd><p>Default: ‘Yes’ to include only headlines in the output.</p>
</dd>
<dt>flagignorefiles:</dt><dd><p>Default: ‘Yes’ to ignore &#64;file nodes.</p>
</dd>
<dt>use_xhtml:</dt><dd><p>Yes to include xhtml doctype declarations and make the file valid XHTML 1.0 Strict.
Otherwise only a simple &lt;html&gt; tag is used although the output will be xhtml
compliant otherwise. Default: Yes</p>
</dd>
<dt>bullet_type:</dt><dd><p>If this is ‘bullet’ then the output will be in the form of a bulleted list.
If this is ‘number’ then the output will be in the form of a numbered list.
If this is ‘heading’ then the output will use &lt;h?&gt; style headers.</p>
<p>Anything else will result in &lt;h?&gt; type tags being used where ‘?’ will be a
digit starting at 1 and increasing up to a maximum of six depending on depth
of nesting. Default: number</p>
</dd>
<dt>browser_command:</dt><dd><p>Set this to the command needed to launch a browser on your system or leave it blank
to use your systems default browser.</p>
<p>If this is an empty string or the browser can not be launched using this command then
python’s <cite>webbrowser</cite> module will be tried. Using a bad command here will slow down the
launch of the default browser, better to leave it blank.
Default: empty string</p>
</dd>
</dl>
<p><strong>Configuration</strong></p>
<p>At present, the file leo/plugins/leo_to_html.ini contains configuration settings. In particular, the default export path, “c:&quot; must be changed for *nix systems.</p>
</section>
<section id="leo-to-rtf-py">
<h4><a class="toc-backref" href="#id88">leo_to_rtf.py</a><a class="headerlink" href="#leo-to-rtf-py" title="Permalink to this heading">¶</a></h4>
<p>Outputs a Leo outline as a numbered list to an RTF file. The RTF file can be loaded into Microsoft Word and formatted as a proper outline.</p>
<p>If this plug-in loads properly, you should have an “Outline to Microsoft RTF” option added to your File &gt; Export… menu in Leo.</p>
<p>Settings such as outputting just the headlines (vs. headlines &amp; body text) and whether to include or ignore the contents of &#64;file nodes are stored in the rtf_export.ini file in your Leoplugins folder.</p>
<p>The default export path is also stored in the INI file. By default, it’s set to c:so you may need to modify it depending on your system.</p>
</section>
</section>
<section id="user-interface">
<h3><a class="toc-backref" href="#id89">User interface</a><a class="headerlink" href="#user-interface" title="Permalink to this heading">¶</a></h3>
<section id="chapter-hoist-py">
<h4><a class="toc-backref" href="#id90">chapter_hoist.py</a><a class="headerlink" href="#chapter-hoist-py" title="Permalink to this heading">¶</a></h4>
<p>Creates hoist buttons.</p>
<p>This plugin puts two buttons in the icon area: a button called ‘Save Hoist’ and a button called ‘Dehoist’. The ‘Save Hoist’ button hoists the presently selected node and creates a button which can later rehoist the same node. The ‘Dehoist’ button performs one level of dehoisting</p>
<p>Requires at least version 0.19 of mod_scripting.</p>
</section>
<section id="editattributes-py">
<h4><a class="toc-backref" href="#id91">EditAttributes.py</a><a class="headerlink" href="#editattributes-py" title="Permalink to this heading">¶</a></h4>
<p>Lets the user to associate text with a specific node.</p>
<p>Summon it by pressing button-2 or button-3 on an icon Box in the outline. This will create an attribute editor where the user can add, remove and edit attributes. Since attributes use the underlying tnode, clones will share the attributes of one another.</p>
</section>
<section id="interact-py">
<h4><a class="toc-backref" href="#id92">interact.py</a><a class="headerlink" href="#interact-py" title="Permalink to this heading">¶</a></h4>
<p>Adds buttons so Leo can interact with command line environments.</p>
<dl class="field-list simple">
<dt class="field-odd">20100226</dt>
<dd class="field-odd"><p>see also leoscreen.py for a simpler approach.</p>
</dd>
</dl>
<p>Currently implements <cite>bash</cite> shell and <cite>psql</cite> (postresql SQL db shell).</p>
<p>Single-line commands can be entered in the headline with a blank body, multi-line commands can be entered in the body with a descriptive title in the headline.  Press the <cite>bash</cite> or <cite>psql</cite> button to send the command to the appropriate interpreter.</p>
<p>The output from the command is <strong>always</strong> stored in a new node added as the first child of the command node.  For multi-line commands this new node is selected.  For single-line command this new node is not shown, instead the body text of the command node is updated to reflect the most recent output.  Comment delimiter magic is used to allow single-line and multi-line commands to maintain their single-line and multi-line flavors.</p>
<p>Both the new child nodes and the updated body text of single-line commands are timestamped.</p>
<p>For the <cite>bash</cite> button the execution directory is either the directory containing the <cite>.leo</cite> file, or any other path as specified by ancestor <cite>&#64;path</cite> nodes.</p>
<p>Currently the <cite>psql</cite> button just connects to the default database.  “;” is required at the end of SQL statements.</p>
<p>Requires <cite>pexpect</cite> module.</p>
</section>
<section id="maximizenewwindows-py">
<h4><a class="toc-backref" href="#id93">maximizeNewWindows.py</a><a class="headerlink" href="#maximizenewwindows-py" title="Permalink to this heading">¶</a></h4>
<p>Maximizes all new windows.</p>
</section>
<section id="mod-framesize-py">
<h4><a class="toc-backref" href="#id94">mod_framesize.py</a><a class="headerlink" href="#mod-framesize-py" title="Permalink to this heading">¶</a></h4>
<p>Sets a hard coded frame size.</p>
<p>Prevents Leo from setting custom frame size (e.g. from an external .leo document)</p>
</section>
<section id="plugins-menu-py">
<h4><a class="toc-backref" href="#id95">plugins_menu.py</a><a class="headerlink" href="#plugins-menu-py" title="Permalink to this heading">¶</a></h4>
<p>Creates a Plugins menu and adds all actives plugins to it.</p>
<p>Selecting these menu items will bring up a short <strong>About Plugin</strong> dialog with the details of the plugin. In some circumstances a submenu will be created instead and an ‘About’ menu entry will be created in this.</p>
<p><strong>INI files and the Properties Dialog</strong></p>
<p>If a file exists in the plugins directory with the same file name as the plugin but with a .ini extension instead of .py, then a <strong>Properties</strong> item will be created in a submenu. Selecting this item will pop up a Properties Dialog which will allow the contents of this file to be edited.</p>
<p>The .ini file should be formatted for use by the python ConfigParser class.</p>
<p><strong>Special Methods</strong></p>
<p>Certain methods defined at the top level are considered special.</p>
<dl class="simple">
<dt>cmd_XZY</dt><dd><p>If a method is defined at the module level with a name of the form
<strong>cmd_XZY</strong> then a menu item <strong>XZY</strong> will be created which will invoke
<strong>cmd_XZY</strong> when it is selected. These menus will appear in a sub menu.</p>
</dd>
</dl>
<p>applyConfiguration</p>
<dl class="simple">
<dt>topLevelMenu</dt><dd><p>This method, if it exists, will be called when the user clicks on the plugin
name in the plugins menu (or the <strong>About</strong> item in its submenu), but only if
the plugin was loaded properly and registered with g.plugin_signon.</p>
</dd>
</dl>
<p><strong>Special Variable Names</strong></p>
<p>Some names defined at the top level have special significance.</p>
<dl class="simple">
<dt>__plugin_name__</dt><dd><p>This will be used to define the name of the plugin and will be used
as a label for its menu entry.</p>
</dd>
<dt>__plugin_priority__</dt><dd><p>Plugins can also attempt to select the order they will appear in the menu by
defining a __plugin_priority__. The menu will be created with the highest
priority items first. This behavior is not guaranteed since other plugins
can define any priority. This priority does not affect the order of calling
handlers.
To change the order select a number outside the range 0-200 since this range
is used internally for sorting alphabetically. Properties and INI files.</p>
</dd>
</dl>
</section>
<section id="redirect-to-log-py">
<h4><a class="toc-backref" href="#id96">redirect_to_log.py</a><a class="headerlink" href="#redirect-to-log-py" title="Permalink to this heading">¶</a></h4>
<p>Sends all output to the log pane.</p>
</section>
<section id="scripts-menu-py">
<h4><a class="toc-backref" href="#id97">scripts_menu.py</a><a class="headerlink" href="#scripts-menu-py" title="Permalink to this heading">¶</a></h4>
<p>Creates a Scripts menu for LeoPy.leo.</p>
</section>
<section id="unl-py">
<h4><a class="toc-backref" href="#id98">UNL.py</a><a class="headerlink" href="#unl-py" title="Permalink to this heading">¶</a></h4>
<p>Supports Uniform Node Locators (UNL’s) for linking to nodes in any Leo file.</p>
<p>UNL’s specify nodes within any Leo file. You can use them to create cross-Leo-file links! UNL</p>
<p>This plugin consists of two parts:</p>
<ol class="arabic simple">
<li><p>Selecting a node shows the UNL in the status line at the bottom of the Leo window. You can copy from the status line and paste it into headlines, emails, whatever.</p></li>
<li><p>Double-clicking &#64;url nodes containing UNL’s select the node specified in the UNL. If the UNL species in another Leo file, the other file will be opened.</p></li>
</ol>
<p>Format of UNL’s:</p>
<p>UNL’s referring to nodes within the present outline have the form:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">headline1</span><span class="o">--&gt;</span><span class="n">headline2</span><span class="o">--&gt;...--&gt;</span><span class="n">headlineN</span>
</pre></div>
</div>
<p>headline1 is the headline of a top-level node, and each successive headline is the headline of a child node.</p>
<p>UNL’s of the form:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">file</span><span class="p">:</span><span class="o">&lt;</span><span class="n">path</span><span class="o">&gt;</span><span class="c1">#headline1--&gt;...--&gt;headlineN</span>
</pre></div>
</div>
<p>refer to a node specified in &lt;path&gt; For example, double clicking the following headline will take you to Chapter 8 of Leo’s Users Guide:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@url</span> <span class="n">file</span><span class="p">:</span><span class="n">c</span><span class="p">:</span><span class="o">/</span><span class="n">prog</span><span class="o">/</span><span class="n">leoCvs</span><span class="o">/</span><span class="n">leo</span><span class="o">/</span><span class="n">doc</span><span class="o">/</span><span class="n">leoDocs</span><span class="o">.</span><span class="n">leo</span><span class="c1">#Users Guide--&gt;Chapter 8: Customizing Leo</span>
</pre></div>
</div>
<p>For example, suppose you want to email someone with comments about a Leo file. Create a comments.leo file containing &#64;url UNL nodes. That is, headlines are &#64;url followed by a UNL. The body text contains your comments about the nodes in the _other_ Leo file! Send the comments.leo to your friend, who can use the comments.leo file to quickly navigate to the various nodes you are talking about. As another example, you can copy UNL’s into emails. The recipient can navigate to the nodes ‘by hand’ by following the arrows in the UNL.</p>
<p><strong>Notes</strong>:</p>
<ul class="simple">
<li><p>At present, UNL’s refer to nodes by their position in the outline. Moving a node will break the link.</p></li>
<li><p>Don’t refer to nodes that contain UNL’s in the headline. Instead, refer to the parent or child of such nodes.</p></li>
<li><p>You don’t have to replace spaces in URL’s or UNL’s by ‘%20’.</p></li>
</ul>
</section>
<section id="zenity-file-dialogs-py">
<h4><a class="toc-backref" href="#id99">zenity_file_dialogs.py</a><a class="headerlink" href="#zenity-file-dialogs-py" title="Permalink to this heading">¶</a></h4>
<p>Replaces the gui file dialogs on Linux with external calls to the zenity gtk dialog package.</p>
<p>This plugin is more a proof of concept demo than a useful tool.  The dialogs presented do not take filters and starting folders can not be specified.</p>
<p>Despite this, some Linux users might prefer it to the gui dialogs.</p>
</section>
</section>
</section>
<section id="qt-only-plugins">
<h2><a class="toc-backref" href="#id100">Qt only plugins</a><a class="headerlink" href="#qt-only-plugins" title="Permalink to this heading">¶</a></h2>
<section id="attrib-edit-py">
<h3><a class="toc-backref" href="#id101">attrib_edit.py</a><a class="headerlink" href="#attrib-edit-py" title="Permalink to this heading">¶</a></h3>
<p>Edits user attributes in a Qt frame.</p>
<p>This plugin creates a frame for editing attributes similar to:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Name</span><span class="p">:</span>   <span class="n">Fred</span> <span class="n">Blogs</span>
<span class="n">Home</span><span class="p">:</span>   <span class="mi">555</span><span class="o">-</span><span class="mi">555</span><span class="o">-</span><span class="mi">5555</span>
<span class="n">Work</span><span class="p">:</span>   <span class="mi">555</span><span class="o">-</span><span class="mi">555</span><span class="o">-</span><span class="mi">5556</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">attrib_edit</span></code> is also intended to provide attribute editing for other plugins, see below.</p>
<p>The attributes can be stored in different ways, three modes are implemented currently:</p>
<dl class="simple">
<dt>v.u mode</dt><dd><p>These attributes are stored in the “unknownAttributes” (uA) data for
each node, accessed via v.u.</p>
</dd>
<dt>Field:</dt><dd><p>Attributes are lines starting (no whitespace) with “AttributeName:” in
the body text.</p>
</dd>
<dt>&#64;Child</dt><dd><p>Attributes are the head strings of child nodes when the head string
starts with <a class="reference external" href="mailto:'&#37;&#52;&#48;AttributeName">‘<span>&#64;</span>AttributeName</a>’ where the first letter (second character)
must be capitalized.</p>
</dd>
</dl>
<p>The plugin defines the following commands, available either in the plugin’s sub-menu in the Plugins menu, or as <code class="docutils literal notranslate"><span class="pre">Alt-X</span> <span class="pre">attrib-edit-*</span></code>.</p>
<dl>
<dt>attrib-edit-modes</dt><dd><p>Select which attribute setting / getting modes to use.  More than one mode
can be used at the same time.</p>
<p>You can also control which modes are active by listing them
with the &#64;data attrib_edit_active_modes setting.  For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Field</span><span class="p">:</span>
<span class="nd">@Child</span>
<span class="c1"># v.u mode</span>
</pre></div>
</div>
<p>would cause only the “Field:” and “&#64;Child” modes to be active be default.</p>
</dd>
<dt>attrib-edit-manage</dt><dd><p>Select which attributes, from all attributes seen so
far in this outline, to include on the current node.</p>
</dd>
<dt>attrib-edit-scan</dt><dd><p>Scan the entire outline for attributes so <code class="docutils literal notranslate"><span class="pre">attrib-edit-manage</span></code>
has the complete list.</p>
</dd>
<dt>attrib-edit-create</dt><dd><p>Create a new attribute on the current node.  If Field: or &#64;Child modes
are active, they simply remind you how to create an attribute in the log pane.
If the “v.u mode” mode is active, you’re prompted for a path for the attribute.
For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">addressbook</span> <span class="n">First</span>
</pre></div>
</div>
<p>to store the attribute in v.u[‘addressbook’][‘_edit’][‘First’]</p>
<p>As a convenience, entering a path like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">todo</span> <span class="n">metadata</span> <span class="n">created</span><span class="o">|</span><span class="n">creator</span><span class="o">|</span><span class="n">revised</span>
</pre></div>
</div>
<p>would create:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">v</span><span class="o">.</span><span class="n">u</span><span class="o">.</span><span class="p">[</span><span class="s1">&#39;todo&#39;</span><span class="p">][</span><span class="s1">&#39;metadata&#39;</span><span class="p">][</span><span class="s1">&#39;_edit&#39;</span><span class="p">][</span><span class="s1">&#39;created&#39;</span><span class="p">]</span>
<span class="n">v</span><span class="o">.</span><span class="n">u</span><span class="o">.</span><span class="p">[</span><span class="s1">&#39;todo&#39;</span><span class="p">][</span><span class="s1">&#39;metadata&#39;</span><span class="p">][</span><span class="s1">&#39;_edit&#39;</span><span class="p">][</span><span class="s1">&#39;creator&#39;</span><span class="p">]</span>
<span class="n">v</span><span class="o">.</span><span class="n">u</span><span class="o">.</span><span class="p">[</span><span class="s1">&#39;todo&#39;</span><span class="p">][</span><span class="s1">&#39;metadata&#39;</span><span class="p">][</span><span class="s1">&#39;_edit&#39;</span><span class="p">][</span><span class="s1">&#39;revised&#39;</span><span class="p">]</span>
</pre></div>
</div>
</dd>
</dl>
<p><strong>Technical details</strong></p>
<p>See the source for complete documentation for use with other plugins. Here are some points of interest:</p>
<ul class="simple">
<li><p>In addition to <code class="docutils literal notranslate"><span class="pre">v.u['addressbook']['_edit']['first']</span></code>, paths like <code class="docutils literal notranslate"><span class="pre">v.u['addressbook']['_edit']['_int']['age']</span></code> may be used to identify type, although currently there’s no difference in the edit widget.</p></li>
<li><p>In the future the plugin may allow other plugins to register to provide attribute path information, instead of just scanning for [‘_edit’] entries in v.u.</p></li>
<li><p>Currently there’s no sorting of the attributes in “v.u mode”, which is a problem for some applications.  It’s unclear where the desired order would be stored, without even more repetition in v.u.  When other plugins can register to manipulate the attribute list each plugin could address this, with unordered presentation in the absence of the client plugin.</p></li>
<li><p>There’s code to have the editor appear in a tab instead of its own area under the body editor, but (a) this is always being buried by output in the log window, and (b) there’s a bug which leaves some (harmless) ghost widgets in the background.  Enable by &#64;setting <code class="docutils literal notranslate"><span class="pre">attrib_edit_placement</span></code> to ‘tab’.</p></li>
</ul>
</section>
<section id="bigdash-py">
<h3><a class="toc-backref" href="#id102">bigdash.py</a><a class="headerlink" href="#bigdash-py" title="Permalink to this heading">¶</a></h3>
<p>Creates a global search window. Use the global-search command to show this window. To restore the original appearance of the window, type help. Requires the whoosh library (‘easy_install whoosh’) to do full text searches.</p>
</section>
<section id="bookmarks-py">
<h3><a class="toc-backref" href="#id103">bookmarks.py</a><a class="headerlink" href="#bookmarks-py" title="Permalink to this heading">¶</a></h3>
<p>Open bookmarks in a list, and show bookmarks in a pane.</p>
</section>
<section id="colorize-headlines-py">
<h3><a class="toc-backref" href="#id104">colorize_headlines.py</a><a class="headerlink" href="#colorize-headlines-py" title="Permalink to this heading">¶</a></h3>
<p>Manipulates appearance of individual tree widget items.</p>
<p>This plugin is mostly an example of how to change the appearance of headlines. As such, it does a relatively mundane chore of highlighting &#64;thin, &#64;auto, &#64;shadow nodes in bold.</p>
</section>
<section id="contextmenu-py">
<h3><a class="toc-backref" href="#id105">contextmenu.py</a><a class="headerlink" href="#contextmenu-py" title="Permalink to this heading">¶</a></h3>
<p>Defines various useful actions for context menus (Qt only).</p>
<p>Examples are:</p>
<ul class="simple">
<li><p>Edit in $EDITOR</p></li>
<li><p>Edit &#64;thin node in $EDITOR (remember to do “refresh” after this!)</p></li>
<li><p>Refresh &#64;thin node from disk (e.g. after editing it in external editor)</p></li>
<li><p>Go to clone</p></li>
</ul>
<p>Here’s an example on how to implement your own context menu items in your plugins:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">nextclone_rclick</span><span class="p">(</span><span class="n">c</span><span class="p">,</span><span class="n">p</span><span class="p">,</span> <span class="n">menu</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot; Go to next clone &quot;&quot;&quot;</span>

    <span class="c1"># only show the item if you are on a clone</span>
    <span class="c1"># this is what makes this &quot;context sensitive&quot;</span>
    <span class="k">if</span> <span class="ow">not</span> <span class="n">p</span><span class="o">.</span><span class="n">isCloned</span><span class="p">():</span>
        <span class="k">return</span>

    <span class="k">def</span> <span class="nf">nextclone_rclick_cb</span><span class="p">():</span>
        <span class="n">c</span><span class="o">.</span><span class="n">goToNextClone</span><span class="p">()</span>

    <span class="c1"># &#39;menu&#39; is a QMenu instance that was created by Leo</span>
    <span class="c1"># in response to right click on tree item</span>

    <span class="n">action</span> <span class="o">=</span> <span class="n">menu</span><span class="o">.</span><span class="n">addAction</span><span class="p">(</span><span class="s2">&quot;Go to clone&quot;</span><span class="p">)</span>
    <span class="n">action</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">action</span><span class="p">,</span> <span class="n">QtCore</span><span class="o">.</span><span class="n">SIGNAL</span><span class="p">(</span><span class="s2">&quot;triggered()&quot;</span><span class="p">),</span> <span class="n">nextclone_rclick_cb</span><span class="p">)</span>
</pre></div>
</div>
<p>And call this in your plugin <em>once</em>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">g</span><span class="o">.</span><span class="n">tree_popup_handlers</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">nextclone_rclick</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="dragdropgoodies-py">
<h3><a class="toc-backref" href="#id106">dragdropgoodies.py</a><a class="headerlink" href="#dragdropgoodies-py" title="Permalink to this heading">¶</a></h3>
<p>Dumps files dropped into Leo.</p>
</section>
<section id="graphcanvas-py">
<h3><a class="toc-backref" href="#id107">graphcanvas.py</a><a class="headerlink" href="#graphcanvas-py" title="Permalink to this heading">¶</a></h3>
<p>Adds a graph layout for nodes in a tab. Requires Qt and the backlink.py plugin.</p>
</section>
<section id="leomylyn-py">
<h3><a class="toc-backref" href="#id108">leomylyn.py</a><a class="headerlink" href="#leomylyn-py" title="Permalink to this heading">¶</a></h3>
<p>By Ville M. Vainio
See: <a class="reference external" href="http://en.wikipedia.org/wiki/Mylyn">http://en.wikipedia.org/wiki/Mylyn</a></p>
<p>I went on to start a “leo mylyn” plugin to exercise using the childrenModified and contentModified signals.</p>
<p>If you want to play with it, enable leomylyn.py, modify stuff around the tree and do alt-x mylyn-scores.</p>
<p>Of course as it is useless in this state, but becomes useful when it has a proper gui (maybe in Nav pane), where you would then have a list of “most interesting” nodes.</p>
<p>In the future, this could be able to remember the scores through the sessions, degrade the old scores by time, etc. Also, a scoreset would be associated with a “project” (e.g.”own research”, “work project foo”), each of them having their own typical node working set.</p>
<p>Mylyn was a nice boost back in the eclipse days, it could work for Leo too. My main motivation right now was to demonstrate the signals with something that is much simpler than using them in qmlnotebook.</p>
</section>
<section id="livecode-py">
<h3><a class="toc-backref" href="#id109">livecode.py</a><a class="headerlink" href="#livecode-py" title="Permalink to this heading">¶</a></h3>
<p>The livecode-show commands shows the live code evaluation pane. Hover on the buttons for helpful tool-tips.</p>
<p>Depends on <a class="reference external" href="https://pypi.python.org/pypi/meta">https://pypi.python.org/pypi/meta</a> which you can install with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">meta</span>
</pre></div>
</div>
<p>The dependency on <cite>meta</cite> is for recursively turning AST node trees back into printable identifiers like “m[m[5]]”.  For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">a</span> <span class="o">=</span> <span class="mi">7</span>
</pre></div>
</div>
<p>is easy, but:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">m</span><span class="p">[</span><span class="n">m</span><span class="p">[</span><span class="mi">5</span><span class="p">]]</span> <span class="o">=</span> <span class="mi">7</span>
</pre></div>
</div>
<p>is not.</p>
</section>
<section id="nav-qt-py">
<h3><a class="toc-backref" href="#id110">nav_qt.py</a><a class="headerlink" href="#nav-qt-py" title="Permalink to this heading">¶</a></h3>
<p>Adds “Back” and “Forward” buttons (Qt only).</p>
<p>Creates “back” and “forward” buttons on button bar. These navigate
the node history.</p>
<p>This plugin does not need specific setup. If the plugin is loaded, the buttons
will be available. The buttons use the icon specified in the active Qt style</p>
</section>
<section id="nodetags-py">
<h3><a class="toc-backref" href="#id111">nodetags.py</a><a class="headerlink" href="#nodetags-py" title="Permalink to this heading">¶</a></h3>
<p>Provides node tagging capabilities to Leo. See the docstring for details. By Jacob M. Peck.</p>
</section>
<section id="printing-py">
<h3><a class="toc-backref" href="#id112">printing.py</a><a class="headerlink" href="#printing-py" title="Permalink to this heading">¶</a></h3>
<p>This plugin supports printing using the Qt GUI.
Written by Jacob M. Peck.</p>
</section>
<section id="projectwizard-py">
<h3><a class="toc-backref" href="#id113">projectwizard.py</a><a class="headerlink" href="#projectwizard-py" title="Permalink to this heading">¶</a></h3>
<p>Creates a wizard that creates &#64;auto nodes.</p>
<p>Opens a file dialog and recursively creates &#64;auto &amp; &#64;path nodes from the path
where the selected file is (the selected file itself doesn’t matter.)</p>
</section>
<section id="python-terminal-py">
<h3><a class="toc-backref" href="#id114">python_terminal.py</a><a class="headerlink" href="#python-terminal-py" title="Permalink to this heading">¶</a></h3>
<p>Embeds an python interpreter in Leo’s log pane.</p>
</section>
<section id="qncalendarwidgets">
<h3><a class="toc-backref" href="#id115">QNCalendarWidgets</a><a class="headerlink" href="#qncalendarwidgets" title="Permalink to this heading">¶</a></h3>
<p>Adds a calendar widget in the log area.</p>
</section>
<section id="quicksearch-py">
<h3><a class="toc-backref" href="#id116">quicksearch.py</a><a class="headerlink" href="#quicksearch-py" title="Permalink to this heading">¶</a></h3>
<p>Adds a fast-to-use search widget, like the “Find in files” feature of many editors.</p>
<p>Just load the plugin, activate “Nav” tab, enter search text and press enter.</p>
<p>The pattern to search for is, by default, a case <em>insensitive</em> fnmatch pattern
(e.g. foo*bar), because they are typically easier to type than regexps. If you
want to search for a regexp, use ‘r:’ prefix, e.g. r:foo.*bar.</p>
<p>Regexp matching is case sensitive; if you want to do a case-insensitive regular
expression search (or any kind of case-sensitive search in the first place), do it
by searching for “r:(?i)Foo”. (?i) is a standard feature of Python regular expression
syntax, as documented in</p>
<p><a class="reference external" href="http://docs.python.org/library/re.html#regular-expression-syntax">http://docs.python.org/library/re.html#regular-expression-syntax</a></p>
</section>
<section id="richtext-py">
<h3><a class="toc-backref" href="#id117">richtext.py</a><a class="headerlink" href="#richtext-py" title="Permalink to this heading">¶</a></h3>
<p>Enables rich text using the <a class="reference external" href="http://ckeditor.com/">CKEditor</a> editor.</p>
</section>
<section id="screen-capture-py">
<h3><a class="toc-backref" href="#id118">screen_capture.py</a><a class="headerlink" href="#screen-capture-py" title="Permalink to this heading">¶</a></h3>
<p>By Terry Brown.</p>
<p>screen_capture now captures an image immediately, screen_capture_5sec waits
five seconds, so you can position the pointer, open menus etc. The only
feedback is in the console, as messages in the log would be distracting in
the captured image.</p>
</section>
<section id="screencast-py">
<h3><a class="toc-backref" href="#id119">screencast.py</a><a class="headerlink" href="#screencast-py" title="Permalink to this heading">¶</a></h3>
<p>Screencasts promise to be easy to be <em>much</em> easier to create than slideshows, while also being more interesting, informative and flashy.  It is <em>so</em> much easier to write a screencast script than it is to lay out a slide, take a screenshot, and then manage resulting slide.</p>
<p>In particular, there are few continuity problems with screencasts. Continuity is a <em>huge</em> problem with slideshows!  If I change one slide, I am likely to want to change all following slides.  Which means I have to retake all the slides, and file the new versions in the proper places.  In contrast, any changes to screencasts naturally propagate forward.  There might be an effect on following screencasts scenes, but this will happen rarely with a reasonable scene design, and any problems should be easy to fix.</p>
<p>With screencasts, the <em>movie</em> script is also the <em>python</em> script!  There is no “translation” from one to the other.  Furthermore, all the work to produce a screencast is done (naturally!) within Leo.  No need to create and manage external data.  This is another huge advantage and it make producing screencasts much faster than producing slideshows.</p>
<p>Screencasts may be the long-awaited tools that will allow me to show Leo in action so that other will finally be able to understand it easily.</p>
</section>
<section id="scrolledmessage-py">
<h3><a class="toc-backref" href="#id120">scrolledmessage.py</a><a class="headerlink" href="#scrolledmessage-py" title="Permalink to this heading">¶</a></h3>
<p>Provides a Scrolled Message Dialog service for Qt.</p>
<p>The plugin can display messages supplied as plain text or formatted as html. In
addition the plugin can accept messages in rst format and convert them to be
displayed as html.</p>
<p>The displayed format can be controlled by the user via check boxes, so rst
messages may be viewed either as text or as html. Html messages can also be
viewed as raw text, which will be a good debug feature when creating complex
dynamically generated html messages.</p>
<p>The user interface is provided by a ScrolledMessage.ui file which is dynamically
loaded each time a new dialog is loaded.</p>
<p>The dialog is not modal and many dialogs can exist at one time. Dialogs can be
named and output directed to a dialog with a specific name.</p>
<p>The plugin is invoked like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">g</span><span class="o">.</span><span class="n">doHook</span><span class="p">(</span><span class="s1">&#39;scrolledMessage&#39;</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="n">c</span><span class="p">,</span> <span class="n">msg</span><span class="o">=</span><span class="s1">&#39;message&#39;</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="s1">&#39;title&#39;</span><span class="p">,</span>  <span class="o">...</span><span class="n">etc</span>    <span class="p">)</span>
</pre></div>
</div>
<p>or:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">g</span><span class="o">.</span><span class="n">app</span><span class="o">.</span><span class="n">gui</span><span class="o">.</span><span class="n">runScrolledMessageDialog</span><span class="p">(</span><span class="n">c</span><span class="o">=</span><span class="n">c</span><span class="p">,</span> <span class="o">...</span><span class="n">etc</span><span class="p">)</span>
</pre></div>
</div>
<p>All parameters are optional except c.</p>
<p><strong>Parameters</strong></p>
<dl>
<dt>msg:</dt><dd><p>The text to be displayed (html, rst, plain).</p>
<p>If the text starts with ‘rst:’ it is assumed to be rst text and
is converted to html for display after the rst: prefix has been removed.
If the text starts with ‘&lt;’ it is assumed to be html.
These auto detection features can be overridden by ‘flags’.</p>
</dd>
<dt>label:</dt><dd><p>The text to appear in a label above the display. If it is ‘’, the label is hidden.</p>
</dd>
<dt>title:</dt><dd><p>The title to appear on the window or dock.</p>
</dd>
<dt>flags:</dt><dd><p>Says what kind of message: ‘rst’, ‘text’, ‘html’. This overrides auto-detection.</p>
<p>Flags can be combined, for example, ‘rst html’ causes the message
to be interpreted as rst and displayed as html.</p>
</dd>
</dl>
</section>
<section id="settings-finder-py">
<h3><a class="toc-backref" href="#id121">settings_finder.py</a><a class="headerlink" href="#settings-finder-py" title="Permalink to this heading">¶</a></h3>
<p>Adds the Edit Settings menu tree to the Settings menu.</p>
</section>
<section id="spydershell-py">
<h3><a class="toc-backref" href="#id122">spydershell.py</a><a class="headerlink" href="#spydershell-py" title="Permalink to this heading">¶</a></h3>
<p>Launches the spyder environment with access to Leo instance.
See <a class="reference external" href="http://packages.python.org/spyder/">http://packages.python.org/spyder/</a></p>
<p>Execute alt-x spyder-launch to start spyder. Execute alt-x spyder-update to pass
current c,p,g to spyder interactive session. spyder-update also shows the window
if it was closed before.</p>
</section>
<section id="stickynotes-py">
<h3><a class="toc-backref" href="#id123">stickynotes.py</a><a class="headerlink" href="#stickynotes-py" title="Permalink to this heading">¶</a></h3>
<p>Adds simple “sticky notes” feature (popout editors) for Qt gui.</p>
<p>Adds the following (<code class="docutils literal notranslate"><span class="pre">Alt-X</span></code>) commands:</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">stickynote</span></code></dt><dd><p>pop out current node as a sticky note</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">stickynoter</span></code></dt><dd><p>pop out current node as a rich text note</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">stickynoteenc</span></code></dt><dd><p>pop out current node as an encrypted note</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">stickynoteenckey</span></code></dt><dd><p>enter a new en/decryption key</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tabula</span></code></dt><dd><p>add the current node to the stickynotes in the <cite>Tabula</cite>
sticky note dock window, and show the window</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tabula-show</span></code></dt><dd><p>show the <cite>Tabula</cite> sticky note dock window
(without adding the current node)</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tabula-marked</span></code></dt><dd><p>add all marked nodes to the stickynotes in the <cite>Tabula</cite>
sticky note dock window, and show the window</p>
</dd>
</dl>
<p>Sticky notes are synchronized (both ways) with their parent Leo node.</p>
<p>Encrypted mode requires the python-crypto module.</p>
<p>The first time you open a note in encrypted mode you’ll be asked for a pass
phrase. That phrase will be used for the rest of the session, you can change it
with <code class="docutils literal notranslate"><span class="pre">Alt-X</span></code> <code class="docutils literal notranslate"><span class="pre">stickynoteenckey</span></code>, but probably won’t need to.</p>
<p>The encrypted note is stored in base64 encoded <em>encrypted</em> text in the parent
Leo node, if you forget the pass phrase there’s no way to un-encrypt it again.
Also, you must not edit the text in the Leo node.</p>
<p>When <strong>creating an encrypted note</strong>, you should <strong>start with an empty node</strong>.
If you want to encrypt text that already exists in a node, select-all cut it to
empty the node, then paste it into the note.</p>
</section>
<section id="systray-py">
<h3><a class="toc-backref" href="#id124">systray.py</a><a class="headerlink" href="#systray-py" title="Permalink to this heading">¶</a></h3>
<p>Adds Leo to the system tray.</p>
</section>
<section id="todo-py">
<h3><a class="toc-backref" href="#id125">todo.py</a><a class="headerlink" href="#todo-py" title="Permalink to this heading">¶</a></h3>
<p>Provides to-do list and simple task management for leo (Qt only).</p>
<p>This plugin adds time required, progress and priority settings for nodes. With
the &#64;project tag a branch can display progress and time required with dynamic
hierarchical updates.</p>
<p>For more documentation see: <a class="reference external" href="http://leo.zwiki.org/tododoc">http://leo.zwiki.org/tododoc</a>.</p>
</section>
<section id="valuespace-py">
<h3><a class="toc-backref" href="#id126">valuespace.py</a><a class="headerlink" href="#valuespace-py" title="Permalink to this heading">¶</a></h3>
<p>Supports outline-based calculations similar to spreadsheets.</p>
</section>
<section id="viewrendered-py">
<h3><a class="toc-backref" href="#id127">viewrendered.py</a><a class="headerlink" href="#viewrendered-py" title="Permalink to this heading">¶</a></h3>
<p>Creates a window for <em>live</em> rendering of rst, html, etc.  Qt only.
Supports &#64;graphics-script, &#64;image, &#64;html, &#64;movie and &#64;svg nodes.</p>
<p>viewrendered.py creates a single <code class="docutils literal notranslate"><span class="pre">Alt-X</span></code> style command, <code class="docutils literal notranslate"><span class="pre">viewrendered</span></code>,
which opens a new window where the current body text is rendered as HTML
(if it starts with ‘&lt;’), or otherwise reStructuredText.  reStructuredText
errors and warnings may be shown.  For example, both:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>Heading
-------

`This` is **really** a line of text.
</pre></div>
</div>
<p>and:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">h1</span><span class="o">&gt;</span><span class="n">Heading</span><span class="o">&lt;</span><span class="n">h1</span><span class="o">&gt;</span>

<span class="o">&lt;</span><span class="n">tt</span><span class="o">&gt;</span><span class="n">This</span><span class="o">&lt;/</span><span class="n">tt</span><span class="o">&gt;</span> <span class="ow">is</span> <span class="o">&lt;</span><span class="n">b</span><span class="o">&gt;</span><span class="n">really</span><span class="o">&lt;/</span><span class="n">b</span><span class="o">&gt;</span> <span class="n">a</span> <span class="n">line</span> <span class="n">of</span> <span class="n">text</span><span class="o">.</span>
</pre></div>
</div>
<p>will look something like:</p>
<p><strong>Heading</strong></p>
<p><cite>This</cite> is <strong>really</strong> a line of text.</p>
</section>
<section id="viewrendered2-py">
<h3><a class="toc-backref" href="#id128">viewrendered2.py</a><a class="headerlink" href="#viewrendered2-py" title="Permalink to this heading">¶</a></h3>
<p>An alternative to the viewrendered plugin.  See the plugin’s docstring for details, as well as these two posts:</p>
<p><a class="reference external" href="https://groups.google.com/d/msg/leo-editor/3dH_NSQ4TsQ/ueVewAn50ZcJ">https://groups.google.com/d/msg/leo-editor/3dH_NSQ4TsQ/ueVewAn50ZcJ</a></p>
<p><a class="reference external" href="https://groups.google.com/d/msg/leo-editor/BDzmytlSegw/C0IbSz0US54J">https://groups.google.com/d/msg/leo-editor/BDzmytlSegw/C0IbSz0US54J</a></p>
</section>
<section id="wikiview-py">
<h3><a class="toc-backref" href="#id129">wikiview.py</a><a class="headerlink" href="#wikiview-py" title="Permalink to this heading">¶</a></h3>
<p>Hides/shows parts of urls in the body editor.</p>
</section>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="leo_toc.html">
              <img class="logo" src="_static/LeoLogo.svg" alt="Logo"/>
            </a></p>
  <div>
    <h4>Previous topic</h4>
    <p class="topless"><a href="customizing.html"
                          title="previous chapter">Customizing Leo</a></p>
  </div>
  <div>
    <h4>Next topic</h4>
    <p class="topless"><a href="commands.html"
                          title="next chapter">Leo’s Commands Reference</a></p>
  </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
<div id="sidebarbutton" title="Collapse sidebar">
<span>«</span>
</div>

      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="commands.html" title="Leo’s Commands Reference"
             >next</a> |</li>
        <li class="right" >
          <a href="customizing.html" title="Customizing Leo"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="leo_toc.html">Leo 6.7.2 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="usersguide.html" >Leo’s Users Guide</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">Plugins</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 1997-2023, Edward K. Ream.
      Last updated on February 28, 2023.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
    </div>
  </body>
</html>